Fix starting of bluetooth manager

This commit is contained in:
Erwan Croze 2016-09-06 16:30:27 +02:00
parent bb618d51af
commit 0b3c2af420
2 changed files with 7 additions and 4 deletions

View file

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

View file

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