diff options
author | tiger_huang <tiger_huang@htc.com> | 2015-04-07 17:35:13 +0800 |
---|---|---|
committer | Olawale Ogunwale <ogunwale@google.com> | 2015-04-08 16:10:04 +0000 |
commit | 951e27f344996ee8cba4d6defbe5e4fab3a08284 (patch) | |
tree | 612a296b1a66a3676490a313d430f67e57e852b6 | |
parent | 393f89f26df724a3da7a21b28925a21fe5fb253f (diff) | |
download | frameworks_base-951e27f344996ee8cba4d6defbe5e4fab3a08284.zip frameworks_base-951e27f344996ee8cba4d6defbe5e4fab3a08284.tar.gz frameworks_base-951e27f344996ee8cba4d6defbe5e4fab3a08284.tar.bz2 |
Prevent windows from freezing screen while timeout
The original logic lets windows be able to freeze screen again (by
setting win.mOrientationChanging=true) after WINDOW_FREEZE_TIMEOUT is
triggered before mInnerFields.mOrientationChangeComplete is set to
true. In this case, we would lose the protection of
WINDOW_FREEZE_TIMEOUT. If the app never finishes drawing the window,
the screen would keep freezing that the user cannot operate the
device.
Change-Id: I45a0a9e4b3f8d5b0b0043229bfa4890236ae8ab2
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 8008064..8998d39 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4717,7 +4717,8 @@ public class WindowManagerService extends IWindowManager.Stub WindowState w = wtoken.allAppWindows.get(i); if (w.mAppFreezing) { w.mAppFreezing = false; - if (w.mHasSurface && !w.mOrientationChanging) { + if (w.mHasSurface && !w.mOrientationChanging + && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) { if (DEBUG_ORIENTATION) Slog.v(TAG, "set mOrientationChanging of " + w); w.mOrientationChanging = true; mInnerFields.mOrientationChangeComplete = false; @@ -9083,7 +9084,7 @@ public class WindowManagerService extends IWindowManager.Stub // If the screen is currently frozen or off, then keep // it frozen/off until this window draws at its new // orientation. - if (!okToDisplay()) { + if (!okToDisplay() && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) { if (DEBUG_ORIENTATION) Slog.v(TAG, "Changing surface while display frozen: " + w); w.mOrientationChanging = true; w.mLastFreezeDuration = 0; |