diff options
| author | 2015-04-24 16:03:47 -0700 | |
|---|---|---|
| committer | 2015-04-24 17:12:08 -0700 | |
| commit | 602c68e4ffa1d17b2032c0e05c5d4d4dc8795adf (patch) | |
| tree | 3585ae29b83dc9211e6935f7ab8bfb0e8a76bb91 | |
| parent | 4a963ac2fa22d633825db1ba1313e11276665ab4 (diff) | |
Smooth transitions between SHOW_WHEN_LOCKED activities
Bug: 12536117
Change-Id: Ia5f96e49587661440ae31fba17c42b2e3a9557fb
| -rw-r--r-- | services/core/java/com/android/server/policy/PhoneWindowManager.java | 32 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowAnimator.java | 6 |
2 files changed, 31 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 25857c5d5062..5536d4dd5f19 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -2151,6 +2151,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { win.setType( WindowManager.LayoutParams.TYPE_APPLICATION_STARTING); + + synchronized (mWindowManagerFuncs.getWindowManagerLock()) { + // Assumes it's safe to show starting windows of launched apps while + // the keyguard is being hidden. This is okay because starting windows never show + // secret information. + if (mKeyguardHidden) { + windowFlags |= FLAG_SHOW_WHEN_LOCKED; + } + } + // Force the window flags: this is a fake window, so it is not really // touchable or focusable by the user. We also add in the ALT_FOCUSABLE_IM // flag because we do know that the next window will take input @@ -4131,6 +4141,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (attrs.type == TYPE_STATUS_BAR && (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) { mForceStatusBarFromKeyguard = true; } + + boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW + && attrs.type < FIRST_SYSTEM_WINDOW; + final boolean showWhenLocked = (fl & FLAG_SHOW_WHEN_LOCKED) != 0; + final boolean dismissKeyguard = (fl & FLAG_DISMISS_KEYGUARD) != 0; + if (mTopFullscreenOpaqueWindowState == null && win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw()) { if ((fl & FLAG_FORCE_NOT_FULLSCREEN) != 0) { @@ -4143,8 +4159,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if ((attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) { mShowingLockscreen = true; } - boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW - && attrs.type < FIRST_SYSTEM_WINDOW; if (attrs.type == TYPE_DREAM) { // If the lockscreen was showing when the dream started then wait // for the dream to draw before hiding the lockscreen. @@ -4155,8 +4169,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } - final boolean showWhenLocked = (fl & FLAG_SHOW_WHEN_LOCKED) != 0; - final boolean dismissKeyguard = (fl & FLAG_DISMISS_KEYGUARD) != 0; if (appWindow) { final IApplicationToken appToken = win.getAppToken(); if (showWhenLocked) { @@ -4210,10 +4222,20 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if (mWinShowWhenLocked != null && - mWinShowWhenLocked.getAppToken() != win.getAppToken()) { + mWinShowWhenLocked.getAppToken() != win.getAppToken() && + (attrs.flags & FLAG_SHOW_WHEN_LOCKED) == 0) { win.hideLw(false); } } + } else if (mTopFullscreenOpaqueWindowState == null && mWinShowWhenLocked == null) { + // No TopFullscreenOpaqueWindow is showing, but we found a SHOW_WHEN_LOCKED window + // that is being hidden in an animation - keep the + // keyguard hidden until the new window shows up and + // we know whether to show the keyguard or not. + if (win.isAnimatingLw() && appWindow && showWhenLocked) { + mHideLockScreen = true; + mWinShowWhenLocked = win; + } } if (mTopFullscreenOpaqueOrDimmingWindowState == null && win.isVisibleOrBehindKeyguardLw() && !win.isGoneForLayoutLw() diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 897b865d92b1..52071cca29b9 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -201,9 +201,11 @@ public class WindowAnimator { null : winShowWhenLocked.mAppToken; final boolean hideWhenLocked = !(((win.mIsImWindow || imeTarget == win) && showImeOverKeyguard) - || (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken || + || (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken + // Show all SHOW_WHEN_LOCKED windows while they're animating + || (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0 && win.isAnimatingLw() // Show error dialogs over apps that dismiss keyguard. - (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0))); + || (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0))); return ((mForceHiding == KEYGUARD_ANIMATING_IN) && (!win.mWinAnimator.isAnimating() || hideWhenLocked)) || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked); |