Loading core/java/android/view/WindowManagerPolicy.java +6 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,12 @@ public interface WindowManagerPolicy { void registerShortcutKey(long shortcutCode, IShortcutService shortcutKeyReceiver) throws RemoteException; /** * @return true if windows with FLAG_DISMISS_KEYGUARD should be allowed to show even if * the keyguard is locked. */ boolean canShowDismissingWindowWhileLockedLw(); /** * Interface to the Window Manager state associated with a particular * window. You can hold on to an instance of this interface from the call Loading core/java/com/android/internal/policy/IKeyguardService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ oneway interface IKeyguardService { void addStateMonitorCallback(IKeyguardStateCallback callback); void verifyUnlock(IKeyguardExitCallback callback); void keyguardDone(boolean authenticated, boolean wakeup); void dismiss(); void dismiss(boolean allowWhileOccluded); void onDreamingStarted(); void onDreamingStopped(); Loading core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -19,4 +19,5 @@ interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); } No newline at end of file packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +2 −2 Original line number Diff line number Diff line Loading @@ -98,9 +98,9 @@ public class KeyguardService extends Service { } @Override // Binder interface public void dismiss() { public void dismiss(boolean allowWhileOccluded) { checkPermission(); mKeyguardViewMediator.dismiss(); mKeyguardViewMediator.dismiss(allowWhileOccluded); } @Override // Binder interface Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +38 −7 Original line number Diff line number Diff line Loading @@ -363,7 +363,7 @@ public class KeyguardViewMediator extends SystemUI { UserInfo info = UserManager.get(mContext).getUserInfo(userId); if (info != null && (info.isGuest() || info.isDemo())) { // If we just switched to a guest, try to dismiss keyguard. dismiss(); dismiss(false /* allowWhileOccluded */); } } } Loading Loading @@ -500,6 +500,17 @@ public class KeyguardViewMediator extends SystemUI { userId); } } @Override public void onTrustChanged(int userId) { if (userId == KeyguardUpdateMonitor.getCurrentUser()) { synchronized (KeyguardViewMediator.this) { notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(userId)); } } } }; ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() { Loading Loading @@ -1253,15 +1264,16 @@ public class KeyguardViewMediator extends SystemUI { /** * Dismiss the keyguard through the security layers. * @param allowWhileOccluded if true, dismiss the keyguard even if it's currently occluded. */ public void handleDismiss() { if (mShowing && !mOccluded) { public void handleDismiss(boolean allowWhileOccluded) { if (mShowing && (allowWhileOccluded || !mOccluded)) { mStatusBarKeyguardViewManager.dismiss(); } } public void dismiss() { mHandler.sendEmptyMessage(DISMISS); public void dismiss(boolean allowWhileOccluded) { mHandler.obtainMessage(DISMISS, allowWhileOccluded ? 1 : 0, 0).sendToTarget(); } /** Loading Loading @@ -1355,6 +1367,9 @@ public class KeyguardViewMediator extends SystemUI { */ public void setCurrentUser(int newUserId) { KeyguardUpdateMonitor.setCurrentUser(newUserId); synchronized (this) { notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(newUserId)); } } private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { Loading Loading @@ -1463,7 +1478,7 @@ public class KeyguardViewMediator extends SystemUI { } break; case DISMISS: handleDismiss(); handleDismiss(msg.arg1 == 1 ? true : false /* allowWhileOccluded */); break; case START_KEYGUARD_EXIT_ANIM: Trace.beginSection("KeyguardViewMediator#handleMessage START_KEYGUARD_EXIT_ANIM"); Loading Loading @@ -1989,6 +2004,20 @@ public class KeyguardViewMediator extends SystemUI { } } private void notifyTrustedChangedLocked(boolean trusted) { int size = mKeyguardStateCallbacks.size(); for (int i = size - 1; i >= 0; i--) { try { mKeyguardStateCallbacks.get(i).onTrustedChanged(trusted); } catch (RemoteException e) { Slog.w(TAG, "Failed to call notifyTrustedChangedLocked", e); if (e instanceof DeadObjectException) { mKeyguardStateCallbacks.remove(i); } } } } public void addStateMonitorCallback(IKeyguardStateCallback callback) { synchronized (this) { mKeyguardStateCallbacks.add(callback); Loading @@ -1996,8 +2025,10 @@ public class KeyguardViewMediator extends SystemUI { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged or onSimSecureStateChanged or onInputRestrictedStateChanged", e); Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e); } } } Loading Loading
core/java/android/view/WindowManagerPolicy.java +6 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,12 @@ public interface WindowManagerPolicy { void registerShortcutKey(long shortcutCode, IShortcutService shortcutKeyReceiver) throws RemoteException; /** * @return true if windows with FLAG_DISMISS_KEYGUARD should be allowed to show even if * the keyguard is locked. */ boolean canShowDismissingWindowWhileLockedLw(); /** * Interface to the Window Manager state associated with a particular * window. You can hold on to an instance of this interface from the call Loading
core/java/com/android/internal/policy/IKeyguardService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ oneway interface IKeyguardService { void addStateMonitorCallback(IKeyguardStateCallback callback); void verifyUnlock(IKeyguardExitCallback callback); void keyguardDone(boolean authenticated, boolean wakeup); void dismiss(); void dismiss(boolean allowWhileOccluded); void onDreamingStarted(); void onDreamingStopped(); Loading
core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -19,4 +19,5 @@ interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); } No newline at end of file
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +2 −2 Original line number Diff line number Diff line Loading @@ -98,9 +98,9 @@ public class KeyguardService extends Service { } @Override // Binder interface public void dismiss() { public void dismiss(boolean allowWhileOccluded) { checkPermission(); mKeyguardViewMediator.dismiss(); mKeyguardViewMediator.dismiss(allowWhileOccluded); } @Override // Binder interface Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +38 −7 Original line number Diff line number Diff line Loading @@ -363,7 +363,7 @@ public class KeyguardViewMediator extends SystemUI { UserInfo info = UserManager.get(mContext).getUserInfo(userId); if (info != null && (info.isGuest() || info.isDemo())) { // If we just switched to a guest, try to dismiss keyguard. dismiss(); dismiss(false /* allowWhileOccluded */); } } } Loading Loading @@ -500,6 +500,17 @@ public class KeyguardViewMediator extends SystemUI { userId); } } @Override public void onTrustChanged(int userId) { if (userId == KeyguardUpdateMonitor.getCurrentUser()) { synchronized (KeyguardViewMediator.this) { notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(userId)); } } } }; ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() { Loading Loading @@ -1253,15 +1264,16 @@ public class KeyguardViewMediator extends SystemUI { /** * Dismiss the keyguard through the security layers. * @param allowWhileOccluded if true, dismiss the keyguard even if it's currently occluded. */ public void handleDismiss() { if (mShowing && !mOccluded) { public void handleDismiss(boolean allowWhileOccluded) { if (mShowing && (allowWhileOccluded || !mOccluded)) { mStatusBarKeyguardViewManager.dismiss(); } } public void dismiss() { mHandler.sendEmptyMessage(DISMISS); public void dismiss(boolean allowWhileOccluded) { mHandler.obtainMessage(DISMISS, allowWhileOccluded ? 1 : 0, 0).sendToTarget(); } /** Loading Loading @@ -1355,6 +1367,9 @@ public class KeyguardViewMediator extends SystemUI { */ public void setCurrentUser(int newUserId) { KeyguardUpdateMonitor.setCurrentUser(newUserId); synchronized (this) { notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(newUserId)); } } private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { Loading Loading @@ -1463,7 +1478,7 @@ public class KeyguardViewMediator extends SystemUI { } break; case DISMISS: handleDismiss(); handleDismiss(msg.arg1 == 1 ? true : false /* allowWhileOccluded */); break; case START_KEYGUARD_EXIT_ANIM: Trace.beginSection("KeyguardViewMediator#handleMessage START_KEYGUARD_EXIT_ANIM"); Loading Loading @@ -1989,6 +2004,20 @@ public class KeyguardViewMediator extends SystemUI { } } private void notifyTrustedChangedLocked(boolean trusted) { int size = mKeyguardStateCallbacks.size(); for (int i = size - 1; i >= 0; i--) { try { mKeyguardStateCallbacks.get(i).onTrustedChanged(trusted); } catch (RemoteException e) { Slog.w(TAG, "Failed to call notifyTrustedChangedLocked", e); if (e instanceof DeadObjectException) { mKeyguardStateCallbacks.remove(i); } } } } public void addStateMonitorCallback(IKeyguardStateCallback callback) { synchronized (this) { mKeyguardStateCallbacks.add(callback); Loading @@ -1996,8 +2025,10 @@ public class KeyguardViewMediator extends SystemUI { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged or onSimSecureStateChanged or onInputRestrictedStateChanged", e); Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e); } } } Loading