Commit 0df361ce authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

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

parent e1fe926b
......@@ -85,7 +85,6 @@ public class AndroidPlatformHelper {
private NetworkManagerInterface mNetworkManager;
private Handler mMainHandler;
private boolean mMonitoringEnabled;
private boolean mIsInInteractiveMode;
private InteractivityReceiver mInteractivityReceiver;
private IntentFilter mInteractivityIntentFilter;
private String[] mDnsServers;
......@@ -110,7 +109,6 @@ public class AndroidPlatformHelper {
mResources = mContext.getResources();
mMainHandler = new Handler(mContext.getMainLooper());
mIsInInteractiveMode = true;
mDozeModeEnabled = false;
MediastreamerAndroidContext.setContext(mContext);
......@@ -652,12 +650,6 @@ public class AndroidPlatformHelper {
Log.i("[Platform Helper] Device idle mode: " + mDozeModeEnabled);
}
public synchronized void setInteractiveMode(boolean b) {
mIsInInteractiveMode = b;
Log.i("[Platform Helper] Device interactive mode: " + mIsInInteractiveMode);
enableKeepAlive(mNativePtr, mIsInInteractiveMode);
}
private NetworkManagerInterface createNetworkManager() {
NetworkManagerInterface networkManager = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
......
......@@ -57,11 +57,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] Device is in interactive mode");
mHelper.setInteractiveMode(true);
Log.i("[Platform Helper] Device is in interactive mode (screen is ON)");
} else if (action.equalsIgnoreCase(Intent.ACTION_SCREEN_OFF)) {
Log.i("[Platform Helper] Device is not in interactive mode");
mHelper.setInteractiveMode(false);
Log.i("[Platform Helper] Device is not in interactive mode (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