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 {
private NetworkManagerInterface mNetworkManager;
private Handler mMainHandler;
private boolean mMonitoringEnabled;
private boolean mIsInInteractiveMode;
private InteractivityReceiver mInteractivityReceiver;
private String[] mDnsServers;
......@@ -109,7 +108,6 @@ public class AndroidPlatformHelper {
mResources = mContext.getResources();
mMainHandler = new Handler(mContext.getMainLooper());
mIsInInteractiveMode = true;
mDozeModeEnabled = false;
MediastreamerAndroidContext.setContext(mContext);
......@@ -667,11 +665,6 @@ public class AndroidPlatformHelper {
mDozeModeEnabled = b;
}
public synchronized void setInteractiveMode(boolean b) {
mIsInInteractiveMode = b;
enableKeepAlive(mNativePtr, mIsInInteractiveMode);
}
private NetworkManagerInterface createNetworkManager() {
NetworkManagerInterface networkManager = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
......
......@@ -39,11 +39,9 @@ public class InteractivityReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_ON)) {
Log.i("[Platform Helper] [Interactivity Receiver] Device is in interactive mode");
if (mHelper != null) mHelper.setInteractiveMode(true);
Log.i("[Platform Helper] [Interactivity Receiver] Device screen is ON");
} else if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_OFF)) {
Log.i("[Platform Helper] [Interactivity Receiver] Device is not in interactive mode");
if (mHelper != null) mHelper.setInteractiveMode(false);
Log.i("[Platform Helper] [Interactivity Receiver] Device screen is OFF");
}
}
}
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