Commit 7c3d0b14 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Do not disable keep alives based on Android screen on/off state

parent 809cc404
...@@ -79,7 +79,6 @@ public class AndroidPlatformHelper { ...@@ -79,7 +79,6 @@ public class AndroidPlatformHelper {
private NetworkManagerInterface mNetworkManager; private NetworkManagerInterface mNetworkManager;
private Handler mMainHandler; private Handler mMainHandler;
private boolean mMonitoringEnabled; private boolean mMonitoringEnabled;
private boolean mIsInInteractiveMode;
private InteractivityReceiver mInteractivityReceiver; private InteractivityReceiver mInteractivityReceiver;
private String[] mDnsServers; private String[] mDnsServers;
...@@ -109,7 +108,6 @@ public class AndroidPlatformHelper { ...@@ -109,7 +108,6 @@ public class AndroidPlatformHelper {
mResources = mContext.getResources(); mResources = mContext.getResources();
mMainHandler = new Handler(mContext.getMainLooper()); mMainHandler = new Handler(mContext.getMainLooper());
mIsInInteractiveMode = true;
mDozeModeEnabled = false; mDozeModeEnabled = false;
MediastreamerAndroidContext.setContext(mContext); MediastreamerAndroidContext.setContext(mContext);
...@@ -667,11 +665,6 @@ public class AndroidPlatformHelper { ...@@ -667,11 +665,6 @@ public class AndroidPlatformHelper {
mDozeModeEnabled = b; mDozeModeEnabled = b;
} }
public synchronized void setInteractiveMode(boolean b) {
mIsInInteractiveMode = b;
enableKeepAlive(mNativePtr, mIsInInteractiveMode);
}
private NetworkManagerInterface createNetworkManager() { private NetworkManagerInterface createNetworkManager() {
NetworkManagerInterface networkManager = null; NetworkManagerInterface networkManager = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
......
...@@ -39,11 +39,9 @@ public class InteractivityReceiver extends BroadcastReceiver { ...@@ -39,11 +39,9 @@ public class InteractivityReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
String action = intent.getAction(); String action = intent.getAction();
if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_ON)) { if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_ON)) {
Log.i("[Platform Helper] [Interactivity Receiver] Device is in interactive mode"); Log.i("[Platform Helper] [Interactivity Receiver] Device screen is ON");
if (mHelper != null) mHelper.setInteractiveMode(true);
} else if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_OFF)) { } else if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_OFF)) {
Log.i("[Platform Helper] [Interactivity Receiver] Device is not in interactive mode"); Log.i("[Platform Helper] [Interactivity Receiver] Device screen is OFF");
if (mHelper != null) mHelper.setInteractiveMode(false);
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment