diff options
author | Roman Birg <roman@cyngn.com> | 2016-09-01 14:09:58 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-09-08 12:46:30 -0700 |
commit | 633a906504d89d3d85084d2e3088f65cfc635a80 (patch) | |
tree | 1399af5c53bab7fec187609a13b6d26c597595dc /services | |
parent | e0f87f165ecf0f44be98c5101ade78d746f3322c (diff) | |
download | frameworks_base-633a906504d89d3d85084d2e3088f65cfc635a80.zip frameworks_base-633a906504d89d3d85084d2e3088f65cfc635a80.tar.gz frameworks_base-633a906504d89d3d85084d2e3088f65cfc635a80.tar.bz2 |
PhoneWindowManager: set focus flags on keyguard panels
Ticket: CYNGNOS-3251
Change-Id: I394514335bdaeafdc7b89918ece1fe3d2794647f
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'services')
4 files changed, 32 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 f2d44ab..83eb424 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -1765,13 +1765,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { mNavigationBarLeftInLandscape) { requestTransientBars(mNavigationBar); } - boolean focusedWindowIsExternalKeyguard = false; - if (mFocusedWindow != null) { - focusedWindowIsExternalKeyguard = (mFocusedWindow.getAttrs().type - & WindowManager.LayoutParams.TYPE_KEYGUARD_PANEL) != 0; - } if (mShowKeyguardOnLeftSwipe && isKeyguardShowingOrOccluded() - && focusedWindowIsExternalKeyguard) { + && mKeyguardDelegate.isKeyguardPanelFocused()) { // Show keyguard mKeyguardDelegate.showKeyguard(); } @@ -5066,7 +5061,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { if ((attrs.privateFlags & PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT) != 0) { mForceStatusBarTransparent = true; } - } + } else if (attrs.type == TYPE_KEYGUARD_PANEL) { + if (mKeyguardDelegate.isKeyguardPanelFocused()) { + attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + attrs.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + } else { + attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + attrs.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + } + } boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type < FIRST_SYSTEM_WINDOW; diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java index c881984..a223d05 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java @@ -435,4 +435,11 @@ public class KeyguardServiceDelegate { public void showKeyguard() { mKeyguardService.showKeyguard(); } + + public boolean isKeyguardPanelFocused() { + if (mKeyguardService != null) { + return mKeyguardService.isKeyguardPanelFocused(); + } + return false; + } } diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java index ed909f8..31c7a04 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java @@ -253,4 +253,8 @@ public class KeyguardServiceWrapper implements IKeyguardService { Slog.w(TAG, "Remote Exception", e); } } + + public boolean isKeyguardPanelFocused() { + return mKeyguardStateMonitor.isKeyguardPanelFocused(); + } }
\ No newline at end of file diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java b/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java index 30cff03..09f9087 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java @@ -43,6 +43,7 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { private volatile boolean mIsShowing = true; private volatile boolean mSimSecure = true; private volatile boolean mInputRestricted = true; + private volatile boolean mKeyguardPanelFocused = false; private int mCurrentUserId; @@ -70,6 +71,10 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { return mInputRestricted; } + public boolean isKeyguardPanelFocused() { + return mKeyguardPanelFocused; + } + @Override // Binder interface public void onShowingStateChanged(boolean showing) { mIsShowing = showing; @@ -80,6 +85,11 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { mSimSecure = simSecure; } + @Override // Binder interface + public void onKeyguardPanelFocusChanged(boolean focused) { + mKeyguardPanelFocused = focused; + } + public synchronized void setCurrentUser(int userId) { mCurrentUserId = userId; } @@ -100,5 +110,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { pw.println(prefix + "mSimSecure=" + mSimSecure); pw.println(prefix + "mInputRestricted=" + mInputRestricted); pw.println(prefix + "mCurrentUserId=" + mCurrentUserId); + pw.println(prefix + "mKeyguardPanelFocused=" + mKeyguardPanelFocused); } }
\ No newline at end of file |