diff options
author | Danesh M <danesh@cyngn.com> | 2016-06-17 15:13:27 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-09-08 14:40:58 -0700 |
commit | 14679247af338e55fef546669ed6e27ab082dd94 (patch) | |
tree | 0f8bbe4b2157fad2ef5124dae039a6711cf50015 | |
parent | 130c89371efa99d9a4f94aa75e3f05851856ade5 (diff) | |
download | android_frameworks_base-14679247af338e55fef546669ed6e27ab082dd94.tar.gz android_frameworks_base-14679247af338e55fef546669ed6e27ab082dd94.tar.bz2 android_frameworks_base-14679247af338e55fef546669ed6e27ab082dd94.zip |
WindowAnimator : Check KEYGUARD_PANEL when deciding to show/hide window
By default, if blur is enabled we don't hide the window behind since we
want the user to see it. This is not true for when a KEYGUARD_PANEL is active
since we can't see anything behind it anyway. Only apply blur logic
if KEYGUARD_PANEL is not added.
CYNGNOS-2980
Change-Id: Icecae14455d6e68665bb688e3f6dc4ea9d74e88c
3 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index c1d0ecb951e..d19096bdced 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -665,6 +665,11 @@ public interface WindowManagerPolicy { public WindowState getWinShowWhenLockedLw(); /** + * Returns the current keyguard panel, if such a thing exists. + */ + public WindowState getWinKeyguardPanelLw(); + + /** * Called when the system would like to show a UI to indicate that an * application is starting. You can use this to add a * APPLICATION_STARTING_TYPE window with the given appToken to the window diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 2f57d392183..9048f333c0c 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -2698,6 +2698,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mWinShowWhenLocked; } + @Override + public WindowState getWinKeyguardPanelLw() { + return mKeyguardPanel; + } + /** {@inheritDoc} */ @Override public View addStartingWindow(IBinder appToken, String packageName, int theme, diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 3289c2ea9b0..362e9590069 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -234,7 +234,14 @@ public class WindowAnimator { // Only hide windows if the keyguard is active and not animating away. boolean keyguardOn = mPolicy.isKeyguardShowingOrOccluded() - && (mForceHiding != KEYGUARD_ANIMATING_OUT && !mKeyguardBlurEnabled); + && mForceHiding != KEYGUARD_ANIMATING_OUT; + + final WindowState winKeyguardPanel = (WindowState) mPolicy.getWinKeyguardPanelLw(); + // If a keyguard panel is currently being shown, we should + // continue to hide the windows as if blur is disabled. + if (winKeyguardPanel == null) { + keyguardOn &= !mKeyguardBlurEnabled; + } return keyguardOn && !allowWhenLocked && (win.getDisplayId() == Display.DEFAULT_DISPLAY); } |