Removed useless mHandler.post() now that everything runs in the same thread
This commit is contained in:
parent
304565ef1a
commit
5c2265956d
13 changed files with 255 additions and 434 deletions
|
@ -110,11 +110,11 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
private TextView sendImage, sendMessage, contactName, remoteComposing;
|
||||
private AvatarWithShadow contactPicture;
|
||||
private RelativeLayout uploadLayout, textLayout;
|
||||
private Handler mHandler = new Handler();
|
||||
private List<BubbleChat> lastSentMessagesBubbles;
|
||||
private HashMap<Integer, String> latestImageMessages;
|
||||
private boolean useLinphoneMessageStorage;
|
||||
private ListView messagesList;
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private ProgressBar progressBar;
|
||||
private int bytesSent;
|
||||
|
@ -678,22 +678,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
public void onMessageReceived(LinphoneAddress from, final LinphoneChatMessage message) {
|
||||
if (from.asStringUriOnly().equals(sipUri)) {
|
||||
if (message.getText() != null) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter.refreshHistory();
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
} else if (message.getExternalBodyUrl() != null) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter.refreshHistory();
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
scrollToEnd();
|
||||
}
|
||||
}
|
||||
|
@ -704,9 +694,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
final String finalImage = finalMessage.getExternalBodyUrl();
|
||||
final State finalState=state;
|
||||
if (LinphoneActivity.isInstanciated() && state != State.InProgress) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (finalMessage != null && !finalMessage.equals("")) {
|
||||
LinphoneActivity.instance().onMessageStateChanged(sipUri, finalMessage.getText(), finalState.toInt());
|
||||
} else if (finalImage != null && !finalImage.equals("")) {
|
||||
|
@ -734,9 +721,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public String getSipUri() {
|
||||
|
@ -1092,12 +1076,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
@Override
|
||||
public void isComposingReceived(LinphoneCore lc, LinphoneChatRoom room) {
|
||||
if (chatRoom != null && room != null && chatRoom.getPeerAddress().asStringUriOnly().equals(room.getPeerAddress().asStringUriOnly())) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
remoteComposing.setVisibility(chatRoom.isRemoteComposing() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ import android.graphics.Bitmap;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.ContextMenu;
|
||||
|
@ -60,8 +59,6 @@ import android.widget.TextView;
|
|||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class ChatListFragment extends Fragment implements OnClickListener, OnItemClickListener {
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private LayoutInflater mInflater;
|
||||
private List<String> mConversations, mDrafts;
|
||||
private ListView chatList;
|
||||
|
@ -112,16 +109,11 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
}
|
||||
|
||||
public void refresh() {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mConversations = LinphoneActivity.instance().getChatList();
|
||||
mDrafts = LinphoneActivity.instance().getDraftChatList();
|
||||
mConversations.removeAll(mDrafts);
|
||||
hideAndDisplayMessageIfNoChat();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isVersionUsingNewChatStorage() {
|
||||
try {
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.database.Cursor;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -52,8 +51,6 @@ import android.widget.TextView;
|
|||
*/
|
||||
@SuppressLint("DefaultLocale")
|
||||
public class ContactsFragment extends Fragment implements OnClickListener, OnItemClickListener {
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private LayoutInflater mInflater;
|
||||
private ListView contactsList;
|
||||
private TextView allContacts, linphoneContacts, newContact, noSipContact, noContact;
|
||||
|
@ -278,9 +275,6 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
}
|
||||
|
||||
public void invalidate() {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (searchField != null && searchField.getText().toString().length() > 0) {
|
||||
searchContacts(searchField.getText().toString());
|
||||
} else {
|
||||
|
@ -288,8 +282,6 @@ public class ContactsFragment extends Fragment implements OnClickListener, OnIte
|
|||
}
|
||||
contactsList.setSelectionFromTop(lastKnownPosition, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class ContactsListAdapter extends BaseAdapter implements SectionIndexer {
|
||||
private int margin;
|
||||
|
|
|
@ -30,7 +30,6 @@ import android.content.Context;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.SparseArray;
|
||||
import android.view.ContextMenu;
|
||||
|
@ -53,7 +52,6 @@ import android.widget.TextView;
|
|||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class HistoryFragment extends Fragment implements OnClickListener, OnChildClickListener, OnGroupClickListener {
|
||||
private Handler mHandler = new Handler();
|
||||
private ExpandableListView historyList;
|
||||
private LayoutInflater mInflater;
|
||||
private TextView allCalls, missedCalls, edit, ok, deleteAll, noCallHistory, noMissedCallHistory;
|
||||
|
@ -164,17 +162,12 @@ public class HistoryFragment extends Fragment implements OnClickListener, OnChil
|
|||
}
|
||||
|
||||
private void expandAllGroups() {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int groupToExpand = 0; groupToExpand < historyList.getExpandableListAdapter().getGroupCount(); groupToExpand++) {
|
||||
if (!historyList.isGroupExpanded(groupToExpand)) {
|
||||
historyList.expandGroup(groupToExpand);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getCorrespondentDisplayName(LinphoneCallLog log) {
|
||||
String displayName;
|
||||
|
|
|
@ -76,7 +76,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
|
||||
private static InCallActivity instance;
|
||||
|
||||
private Handler mHandler = new Handler();
|
||||
private Handler mControlsHandler = new Handler();
|
||||
private Runnable mControls;
|
||||
private ImageView switchCamera;
|
||||
|
@ -281,12 +280,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
|
||||
private void refreshInCallActions() {
|
||||
if (mHandler == null) {
|
||||
mHandler = new Handler();
|
||||
}
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!LinphonePreferences.instance().isVideoEnabled()) {
|
||||
video.setEnabled(false);
|
||||
} else {
|
||||
|
@ -339,16 +332,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void enableAndRefreshInCallActions() {
|
||||
if (mHandler == null) {
|
||||
mHandler = new Handler();
|
||||
}
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
addCall.setEnabled(LinphoneManager.getLc().getCallsNb() < LinphoneManager.getLc().getMaxCalls());
|
||||
transfer.setEnabled(getResources().getBoolean(R.bool.allow_transfers));
|
||||
options.setEnabled(!getResources().getBoolean(R.bool.disable_options_in_call) && (addCall.isEnabled() || transfer.isEnabled()));
|
||||
|
@ -365,8 +350,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
|
||||
refreshInCallActions();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void updateStatusFragment(StatusFragment statusFragment) {
|
||||
status = statusFragment;
|
||||
|
@ -459,9 +442,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isVideoEnabled) {
|
||||
video.setEnabled(true);
|
||||
LinphoneCallParams params = call.getCurrentParamsCopy();
|
||||
|
@ -477,14 +457,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void displayCustomToast(final String message, final int duration) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toastRoot));
|
||||
|
||||
|
@ -497,8 +471,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
toast.setView(layout);
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void switchVideo(final boolean displayVideo) {
|
||||
final LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
||||
|
@ -506,9 +478,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//Check if the call is not terminated
|
||||
if(call.getState() == State.CallEnd || call.getState() == State.CallReleased) return;
|
||||
|
||||
|
@ -524,8 +493,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showAudioView() {
|
||||
video.setBackgroundResource(R.drawable.video_on);
|
||||
|
@ -1080,14 +1047,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
|
||||
if(!LinphonePreferences.instance().isVideoEnabled()){
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
video.setEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (state == State.IncomingReceived) {
|
||||
startIncomingCallActivity();
|
||||
|
@ -1095,29 +1056,19 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
|
||||
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
video.setEnabled(false);
|
||||
if(isVideoEnabled(call)){
|
||||
showAudioView();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (state == State.Resuming) {
|
||||
if(LinphonePreferences.instance().isVideoEnabled()){
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
status.refreshStatusItems(call, isVideoEnabled(call));
|
||||
if(call.getCurrentParamsCopy().getVideoEnabled()){
|
||||
showVideoView();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (state == State.StreamsRunning) {
|
||||
|
@ -1129,24 +1080,14 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
enableAndRefreshInCallActions();
|
||||
|
||||
if (status != null) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
videoProgress.setVisibility(View.GONE);
|
||||
status.refreshStatusItems(call, isVideoEnabled(call));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
refreshInCallActions();
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshCallList(getResources());
|
||||
}
|
||||
});
|
||||
|
||||
if (state == State.CallUpdatedByRemote) {
|
||||
// If the correspondent proposes video while audio call
|
||||
|
@ -1160,8 +1101,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
boolean localVideo = call.getCurrentParamsCopy().getVideoEnabled();
|
||||
boolean autoAcceptCameraPolicy = LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests();
|
||||
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) {
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
showAcceptCallUpdateDialog();
|
||||
|
||||
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
||||
|
@ -1171,8 +1110,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
}.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
// else if (remoteVideo && !LinphoneManager.getLc().isInConference() && autoAcceptCameraPolicy) {
|
||||
// mHandler.post(new Runnable() {
|
||||
// @Override
|
||||
|
@ -1183,12 +1120,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
// }
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showAcceptCallUpdateDialog() {
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
|
@ -1199,13 +1132,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
@Override
|
||||
public void callEncryptionChanged(LinphoneCore lc, final LinphoneCall call, boolean encrypted, String authenticationToken) {
|
||||
if (status != null) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
status.refreshStatusItems(call, call.getCurrentParamsCopy().getVideoEnabled());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1291,7 +1219,6 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
|||
}
|
||||
mControls = null;
|
||||
mControlsHandler = null;
|
||||
mHandler = null;
|
||||
|
||||
unbindDrawables(findViewById(R.id.topLayout));
|
||||
instance = null;
|
||||
|
|
|
@ -61,7 +61,6 @@ import android.database.Cursor;
|
|||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.Fragment.SavedState;
|
||||
|
@ -108,7 +107,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
private Fragment dialerFragment, messageListenerFragment, messageListFragment, friendStatusListenerFragment;
|
||||
private SavedState dialerSavedState;
|
||||
private boolean preferLinphoneContacts = false, isAnimationDisabled = false, isContactPresenceDisabled = true;
|
||||
private Handler mHandler = new Handler();
|
||||
private List<Contact> contactList, sipContactList;
|
||||
private Cursor contactCursor, sipContactCursor;
|
||||
private OrientationEventListener mOrientationHelper;
|
||||
|
@ -775,9 +773,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
|
||||
private void displayMissedCalls(final int missedCallsCount) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (missedCallsCount > 0) {
|
||||
missedCalls.setText(missedCallsCount + "");
|
||||
missedCalls.setVisibility(View.VISIBLE);
|
||||
|
@ -789,13 +784,8 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
missedCalls.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void displayMissedChats(final int missedChatCount) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (missedChatCount > 0) {
|
||||
missedChats.setText(missedChatCount + "");
|
||||
if (missedChatCount > 99) {
|
||||
|
@ -812,8 +802,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
missedChats.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
||||
|
@ -842,9 +830,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
|
||||
public void displayCustomToast(final String message, final int duration) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toastRoot));
|
||||
|
||||
|
@ -857,8 +842,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
toast.setView(layout);
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAddresGoToDialerAndCall(String number, String name, Uri photo) {
|
||||
|
@ -1153,9 +1136,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
|
||||
public void resetClassicMenuLayoutAndGoBackToCallIfStillRunning() {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (dialerFragment != null) {
|
||||
((DialerFragment) dialerFragment).resetLayout(false);
|
||||
}
|
||||
|
@ -1171,8 +1151,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public FragmentsAvailable getCurrentFragment() {
|
||||
return currentFragment;
|
||||
|
|
|
@ -448,7 +448,12 @@ public class LinphoneManager implements LinphoneListener {
|
|||
|
||||
mLc = LinphoneCoreFactory.instance().createLinphoneCore(this, mLinphoneConfigFile, mLinphoneFactoryConfigFile, null, c);
|
||||
mLc.addListener((LinphoneCoreListener) c);
|
||||
//initLiblinphone();
|
||||
|
||||
try {
|
||||
initLiblinphone();
|
||||
} catch (LinphoneCoreException e) {
|
||||
Log.e(e);
|
||||
}
|
||||
|
||||
TimerTask lTask = new TimerTask() {
|
||||
@Override
|
||||
|
@ -725,21 +730,6 @@ public class LinphoneManager implements LinphoneListener {
|
|||
|
||||
public void globalState(final LinphoneCore lc, final GlobalState state, final String message) {
|
||||
Log.i("new state [",state,"]");
|
||||
|
||||
if (state == GlobalState.GlobalOn) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (this) {
|
||||
try {
|
||||
initLiblinphone();
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void registrationState(final LinphoneCore lc, final LinphoneProxyConfig proxy,final RegistrationState state,final String message) {
|
||||
|
|
|
@ -156,12 +156,7 @@ public final class LinphoneService extends Service implements LinphoneCallStateL
|
|||
}
|
||||
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.status_level, IC_LEVEL_OFFLINE, bm, mNotifContentIntent, true);
|
||||
|
||||
UIThreadDispatcher.Dispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LinphoneManager.createAndStart(LinphoneService.this);
|
||||
}
|
||||
});
|
||||
|
||||
mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
||||
if (Version.sdkAboveOrEqual(Version.API12_HONEYCOMB_MR1_31X)) {
|
||||
|
@ -419,6 +414,7 @@ public final class LinphoneService extends Service implements LinphoneCallStateL
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void dumpDeviceInformation() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("DEVICE=").append(Build.DEVICE).append("\n");
|
||||
|
|
|
@ -929,8 +929,6 @@ public class SettingsFragment extends PreferencesListFragment implements Linphon
|
|||
public void ecCalibrationStatus(LinphoneCore lc, final EcCalibratorStatus status, final int delayMs, Object data) {
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
CheckBoxPreference echoCancellation = (CheckBoxPreference) findPreference(getString(R.string.pref_echo_cancellation_key));
|
||||
Preference echoCancellerCalibration = findPreference(getString(R.string.pref_echo_canceller_calibration_key));
|
||||
|
||||
|
@ -948,8 +946,6 @@ public class SettingsFragment extends PreferencesListFragment implements Linphon
|
|||
LinphonePreferences.instance().setEchoCancellation(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
|
|
|
@ -199,9 +199,6 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener,
|
|||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
statusLed.setImageResource(getStatusIconResource(state, true));
|
||||
statusText.setText(getStatusIconText(state));
|
||||
try {
|
||||
|
@ -218,8 +215,6 @@ public class StatusFragment extends Fragment implements LinphoneNotifyListener,
|
|||
sliderContentAccounts.invalidate();
|
||||
} catch (IllegalStateException ise) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// private void setMiniLedsForEachAccount() {
|
||||
// if (allAccountsLed == null)
|
||||
|
|
|
@ -59,7 +59,6 @@ public class EchoCancellerCalibrationFragment extends Fragment implements Linpho
|
|||
} catch (LinphoneCoreException e) {
|
||||
Log.e(e, "Unable to calibrate EC");
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,9 +83,6 @@ public class RemoteProvisioningActivity extends Activity implements LinphoneRemo
|
|||
|
||||
@Override
|
||||
public void configuringStatus(LinphoneCore lc, final RemoteProvisioningState state, String message) {
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (spinner != null) spinner.setVisibility(View.GONE);
|
||||
if (state == RemoteProvisioningState.ConfiguringSuccessful) {
|
||||
goToLinphoneActivity();
|
||||
|
@ -93,8 +90,6 @@ public class RemoteProvisioningActivity extends Activity implements LinphoneRemo
|
|||
Toast.makeText(RemoteProvisioningActivity.this, R.string.remote_provisioning_failure, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
|
|
|
@ -22,8 +22,8 @@ import org.linphone.LinphonePreferences;
|
|||
import org.linphone.LinphonePreferences.AccountBuilder;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.LinphoneAddress.TransportType;
|
||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.LinphoneCoreListener;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
|
@ -32,7 +32,6 @@ import android.app.Activity;
|
|||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
|
@ -53,7 +52,6 @@ public class SetupActivity extends FragmentActivity implements OnClickListener,
|
|||
private Fragment fragment;
|
||||
private LinphonePreferences mPrefs;
|
||||
private boolean accountCreated = false;
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -223,21 +221,12 @@ public class SetupActivity extends FragmentActivity implements OnClickListener,
|
|||
|
||||
public void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState state, String smessage) {
|
||||
if (state == RegistrationState.RegistrationOk) {
|
||||
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
mHandler .post(new Runnable () {
|
||||
public void run() {
|
||||
launchEchoCancellerCalibration(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (state == RegistrationState.RegistrationFailed) {
|
||||
mHandler.post(new Runnable () {
|
||||
public void run() {
|
||||
Toast.makeText(SetupActivity.this, getString(R.string.first_launch_bad_login_password), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void checkAccount(String username, String password, String domain) {
|
||||
|
|
Loading…
Reference in a new issue