remove dns server handling and in-call wake lock management, because it is taken in charge by the library now.

This commit is contained in:
Simon Morlat 2017-10-13 19:40:38 +02:00
parent 2fcda61d4f
commit 6cd271d956
2 changed files with 1 additions and 39 deletions

View file

@ -179,7 +179,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
private IntentFilter mCallIntentFilter; private IntentFilter mCallIntentFilter;
private IntentFilter mNetworkIntentFilter; private IntentFilter mNetworkIntentFilter;
private Handler mHandler = new Handler(); private Handler mHandler = new Handler();
private WakeLock mIncallWakeLock;
private WakeLock mProximityWakelock; private WakeLock mProximityWakelock;
private LinphoneAccountCreator accountCreator; private LinphoneAccountCreator accountCreator;
private static List<LinphoneChatMessage> mPendingChatFileMessage; private static List<LinphoneChatMessage> mPendingChatFileMessage;
@ -1011,7 +1010,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
boolean wifiOnly = LinphonePreferences.instance().isWifiOnlyEnabled(); boolean wifiOnly = LinphonePreferences.instance().isWifiOnlyEnabled();
if (wifiOnly){ if (wifiOnly){
if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) { if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
setDnsServers();
mLc.setNetworkReachable(true); mLc.setNetworkReachable(true);
} }
else { else {
@ -1027,7 +1025,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
Log.i("Connectivity has changed."); Log.i("Connectivity has changed.");
mLc.setNetworkReachable(false); mLc.setNetworkReachable(false);
} }
setDnsServers();
mLc.setNetworkReachable(true); mLc.setNetworkReachable(true);
mLastNetworkType = curtype; mLastNetworkType = curtype;
} }
@ -1465,12 +1462,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
routeAudioToReceiver(); routeAudioToReceiver();
} }
} }
if (mIncallWakeLock != null && mIncallWakeLock.isHeld()) {
mIncallWakeLock.release();
Log.i("Last call ended: releasing incall (CPU only) wake lock");
} else {
Log.i("Last call ended: no incall (CPU only) wake lock were held");
}
} }
} }
if (state == State.CallUpdatedByRemote) { if (state == State.CallUpdatedByRemote) {
@ -1497,15 +1488,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
if (state == State.StreamsRunning) { if (state == State.StreamsRunning) {
startBluetooth(); startBluetooth();
setAudioManagerInCallMode(); setAudioManagerInCallMode();
if (mIncallWakeLock == null) {
mIncallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "incall");
}
if (!mIncallWakeLock.isHeld()) {
Log.i("New call active : acquiring incall (CPU only) wake lock");
mIncallWakeLock.acquire();
} else {
Log.i("New call active while incall (CPU only) wake lock already active");
}
} }
} }
@ -1826,26 +1808,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
dozeModeEnabled = b; dozeModeEnabled = b;
} }
public void setDnsServers() {
if (mConnectivityManager == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
return;
if (mConnectivityManager.getActiveNetwork() == null
|| mConnectivityManager.getLinkProperties(mConnectivityManager.getActiveNetwork()) == null)
return;
int i = 0;
List<InetAddress> inetServers = null;
inetServers = mConnectivityManager.getLinkProperties(mConnectivityManager.getActiveNetwork()).getDnsServers();
String[] servers = new String[inetServers.size()];
for (InetAddress address : inetServers) {
servers[i++] = address.getHostAddress();
}
mLc.setDnsServers(servers);
}
public String getmDynamicConfigFile() { public String getmDynamicConfigFile() {
return mDynamicConfigFile; return mDynamicConfigFile;
} }

@ -1 +1 @@
Subproject commit 8d4d875486e7263354c12dedb3a3b589c52a9bda Subproject commit af3d44e60d7547a02f29d3b3948bfa681a769c59