Merge remote-tracking branch 'origin/master' into dev_phonenumber

This commit is contained in:
Simon Morlat 2016-09-08 12:27:57 +02:00
commit d8d0c292d5
6 changed files with 27 additions and 15 deletions

View file

@ -333,6 +333,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
noSipContact.setVisibility(View.GONE); noSipContact.setVisibility(View.GONE);
noContact.setVisibility(View.GONE); noContact.setVisibility(View.GONE);
contactsList.setVisibility(View.VISIBLE); contactsList.setVisibility(View.VISIBLE);
contactsFetchInProgress.setVisibility(View.GONE);
if (onlyDisplayLinphoneContacts) { if (onlyDisplayLinphoneContacts) {
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
@ -344,11 +345,6 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
edit.setEnabled(true); edit.setEnabled(true);
} }
ContactsManager.getInstance().setLinphoneContactsPrefered(onlyDisplayLinphoneContacts); ContactsManager.getInstance().setLinphoneContactsPrefered(onlyDisplayLinphoneContacts);
if (contactsList.getCount() == 0) {
contactsFetchInProgress.setVisibility(View.VISIBLE);
} else {
contactsFetchInProgress.setVisibility(View.GONE);
}
} }
private void changeContactsToggle() { private void changeContactsToggle() {

View file

@ -1451,8 +1451,12 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
} }
if (isTablet()) { if (isTablet()) {
// Prevent fragmentContainer2 to be visible when rotating the device
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2); LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
if (currentFragment == FragmentsAvailable.DIALER) { if (currentFragment == FragmentsAvailable.DIALER
|| currentFragment == FragmentsAvailable.ABOUT
|| currentFragment == FragmentsAvailable.SETTINGS
|| currentFragment == FragmentsAvailable.ACCOUNT_SETTINGS) {
ll.setVisibility(View.GONE); ll.setVisibility(View.GONE);
} }
} }

View file

@ -21,6 +21,7 @@ package org.linphone;
import static android.content.Intent.ACTION_MAIN; import static android.content.Intent.ACTION_MAIN;
import org.linphone.assistant.RemoteProvisioningActivity; import org.linphone.assistant.RemoteProvisioningActivity;
import org.linphone.mediastream.Version;
import org.linphone.tutorials.TutorialLauncherActivity; import org.linphone.tutorials.TutorialLauncherActivity;
import android.app.Activity; import android.app.Activity;
@ -73,6 +74,11 @@ public class LinphoneLauncherActivity extends Activity {
classToStart = LinphoneActivity.class; classToStart = LinphoneActivity.class;
} }
// We need LinphoneService to start bluetoothManager
if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) {
BluetoothManager.getInstance().initBluetooth();
}
mHandler.postDelayed(new Runnable() { mHandler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {

View file

@ -295,6 +295,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
instance = new LinphoneManager(c); instance = new LinphoneManager(c);
instance.startLibLinphone(c); instance.startLibLinphone(c);
TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE; boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE;
setGsmIdle(gsmIdle); setGsmIdle(gsmIdle);
@ -777,10 +778,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
updateNetworkReachability(); updateNetworkReachability();
if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) {
BluetoothManager.getInstance().initBluetooth();
}
resetCameraFromPreferences(); resetCameraFromPreferences();
} }

View file

@ -77,20 +77,29 @@ public class GCMService extends GCMBaseIntentService {
} }
@Override @Override
protected void onRegistered(Context context, String regId) { protected void onRegistered(Context context, final String regId) {
initLogger(context); initLogger(context);
Log.d("[Push Notification] Registered: " + regId); Log.d("[Push Notification] Registered: " + regId);
UIThreadDispatcher.dispatch(new Runnable(){
@Override
public void run() {
LinphonePreferences.instance().setPushNotificationRegistrationID(regId); LinphonePreferences.instance().setPushNotificationRegistrationID(regId);
} }
});
}
@Override @Override
protected void onUnregistered(Context context, String regId) { protected void onUnregistered(Context context, String regId) {
initLogger(context); initLogger(context);
Log.w("[Push Notification] Unregistered: " + regId); Log.w("[Push Notification] Unregistered: " + regId);
UIThreadDispatcher.dispatch(new Runnable(){
@Override
public void run() {
LinphonePreferences.instance().setPushNotificationRegistrationID(null); LinphonePreferences.instance().setPushNotificationRegistrationID(null);
} }
});
}
protected String[] getSenderIds(Context context) { protected String[] getSenderIds(Context context) {
return new String[] { context.getString(R.string.push_sender_id) }; return new String[] { context.getString(R.string.push_sender_id) };

@ -1 +1 @@
Subproject commit 13b4498265ec3e4d356caf79da4cc7d7eb5afef4 Subproject commit b61dd749dec10d1f4bb715de6e0868b50c40f0d6