diff options
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 13 | ||||
-rw-r--r-- | java/com/android/incallui/VideoCallPresenter.java | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index 3a4862233..6c08c497b 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -191,6 +191,8 @@ public class InCallPresenter implements CallList.Listener { /** Determines if the InCall UI is in fullscreen mode or not. */ private boolean mIsFullScreen = false; + private boolean mScreenTimeoutEnabled = true; + private PhoneStateListener mPhoneStateListener = new PhoneStateListener() { @Override @@ -400,6 +402,7 @@ public class InCallPresenter implements CallList.Listener { } private void attemptFinishActivity() { + mScreenTimeoutEnabled = true; final boolean doFinish = (mInCallActivity != null && isActivityStarted()); LogUtil.i("InCallPresenter.attemptFinishActivity", "Hide in call UI: " + doFinish); if (doFinish) { @@ -1077,6 +1080,7 @@ public class InCallPresenter implements CallList.Listener { // TODO(maxwelb) - b/36649622: Investigate this redundant call mStatusBarNotifier.updateNotification(mCallList); } + applyScreenTimeout(); } /*package*/ @@ -1590,13 +1594,18 @@ public class InCallPresenter implements CallList.Listener { public void enableScreenTimeout(boolean enable) { LogUtil.v("InCallPresenter.enableScreenTimeout", "enableScreenTimeout: value=" + enable); + mScreenTimeoutEnabled = enable; + applyScreenTimeout(); + } + + private void applyScreenTimeout() { if (mInCallActivity == null) { - LogUtil.e("InCallPresenter.enableScreenTimeout", "InCallActivity is null."); + LogUtil.e("InCallPresenter.applyScreenTimeout", "InCallActivity is null."); return; } final Window window = mInCallActivity.getWindow(); - if (enable) { + if (mScreenTimeoutEnabled) { window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } else { window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java index 233b2b569..89cddb9c4 100644 --- a/java/com/android/incallui/VideoCallPresenter.java +++ b/java/com/android/incallui/VideoCallPresenter.java @@ -867,7 +867,7 @@ public class VideoCallPresenter false /* isRemotelyHeld */); enableCamera(mVideoCall, false); InCallPresenter.getInstance().setFullScreen(false); - + InCallPresenter.getInstance().enableScreenTimeout(false); mIsVideoMode = false; } |