summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/wm/WindowManagerService.java
diff options
context:
space:
mode:
authortiger_huang <tiger_huang@htc.com>2015-10-12 15:24:37 +0800
committerSteve Kondik <steve@cyngn.com>2015-11-07 05:40:41 -0800
commita89ab17abc9cf5de6c8584fa84f4684d6e3b279d (patch)
treef7d466ef807ea498d18abee7f6e31d35172ec154 /services/core/java/com/android/server/wm/WindowManagerService.java
parent03f1d083c5e42fd115b9baea283d5f9db6a27eaf (diff)
downloadframeworks_base-a89ab17abc9cf5de6c8584fa84f4684d6e3b279d.zip
frameworks_base-a89ab17abc9cf5de6c8584fa84f4684d6e3b279d.tar.gz
frameworks_base-a89ab17abc9cf5de6c8584fa84f4684d6e3b279d.tar.bz2
Re-use orientation from windows if screen is freezing by apps
This patch prevents the app window being re-created repeatedly. With the original logic, if an app which is show-when-locked, which has a different orientation from the keyguard's, and which doesn't handle config changes, is launched when the screen is off, then it would be re-created repeatedly. The original logic prevents this issue when the display is frozen. However, if the screen is off, the display won't be frozen. So this change uses additional variables to detect if there are any apps re- creating their windows. Change-Id: I73d2e384c4ceeeb38d04d04f0665f83cc6fba7ae
Diffstat (limited to 'services/core/java/com/android/server/wm/WindowManagerService.java')
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 8be2048..9db756b 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -3831,7 +3831,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
public int getOrientationLocked() {
- if (mDisplayFrozen) {
+ if (mDisplayFrozen || mAppsFreezingScreen > 0) {
if (mLastWindowForcedOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
if (DEBUG_ORIENTATION) Slog.v(TAG, "Display is frozen, return "
+ mLastWindowForcedOrientation);
@@ -3856,8 +3856,8 @@ public class WindowManagerService extends IWindowManager.Stub
continue;
}
int req = win.mAttrs.screenOrientation;
- if((req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
- (req == ActivityInfo.SCREEN_ORIENTATION_BEHIND)){
+ if ((req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
+ (req == ActivityInfo.SCREEN_ORIENTATION_BEHIND)) {
continue;
}
@@ -3887,7 +3887,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (DEBUG_ORIENTATION) Slog.v(TAG,
"No one is requesting an orientation when the screen is locked");
- return mLastKeyguardForcedOrientation;
+ return mLastWindowForcedOrientation = mLastKeyguardForcedOrientation;
}
}