Loading core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.policy; interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onShowingStateChanged(boolean showing, int userId); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -1310,7 +1310,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { public void doKeyguardTimeout(Bundle options) { mHandler.removeMessages(KEYGUARD_TIMEOUT); Message msg = mHandler.obtainMessage(KEYGUARD_TIMEOUT, options); mHandler.sendMessage(msg); // Treat these messages with priority - A call to timeout means the device should lock // as soon as possible and not wait for other messages on the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); } /** Loading Loading @@ -1497,12 +1499,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { * @see #handleShow */ private void showLocked(Bundle options) { Trace.beginSection("KeyguardViewMediator#showLocked aqcuiring mShowKeyguardWakeLock"); Trace.beginSection("KeyguardViewMediator#showLocked acquiring mShowKeyguardWakeLock"); if (DEBUG) Log.d(TAG, "showLocked"); // ensure we stay awake until we are finished displaying the keyguard mShowKeyguardWakeLock.acquire(); Message msg = mHandler.obtainMessage(SHOW, options); mHandler.sendMessage(msg); // Treat these messages with priority - This call can originate from #doKeyguardTimeout, // meaning the device should lock as soon as possible and not wait for other messages on // the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); Trace.endSection(); } Loading Loading @@ -1664,6 +1669,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { case KEYGUARD_TIMEOUT: synchronized (KeyguardViewMediator.this) { doKeyguardLocked((Bundle) msg.obj); notifyDefaultDisplayCallbacks(mShowing); } break; case DISMISS: Loading Loading @@ -2293,7 +2299,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { for (int i = size - 1; i >= 0; i--) { IKeyguardStateCallback callback = mKeyguardStateCallbacks.get(i); try { callback.onShowingStateChanged(showing); callback.onShowingStateChanged(showing, KeyguardUpdateMonitor.getCurrentUser()); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged", e); if (e instanceof DeadObjectException) { Loading Loading @@ -2342,7 +2348,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { mKeyguardStateCallbacks.add(callback); try { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser()); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); Loading services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java +6 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,12 @@ public class KeyguardServiceWrapper implements IKeyguardService { @Override // Binder interface public void doKeyguardTimeout(Bundle options) { int userId = mKeyguardStateMonitor.getCurrentUser(); if (mKeyguardStateMonitor.isSecure(userId)) { // Preemptively inform the cache that the keyguard will soon be showing, as calls to // doKeyguardTimeout are a signal to lock the device as soon as possible. mKeyguardStateMonitor.onShowingStateChanged(true, userId); } try { mService.doKeyguardTimeout(options); } catch (RemoteException e) { Loading services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java +7 −1 Original line number Diff line number Diff line Loading @@ -83,8 +83,14 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { return mHasLockscreenWallpaper; } public int getCurrentUser() { return mCurrentUserId; } @Override // Binder interface public void onShowingStateChanged(boolean showing) { public void onShowingStateChanged(boolean showing, int userId) { if (userId != mCurrentUserId) return; mIsShowing = showing; mCallback.onShowingChanged(); Loading Loading
core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.policy; interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onShowingStateChanged(boolean showing, int userId); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -1310,7 +1310,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { public void doKeyguardTimeout(Bundle options) { mHandler.removeMessages(KEYGUARD_TIMEOUT); Message msg = mHandler.obtainMessage(KEYGUARD_TIMEOUT, options); mHandler.sendMessage(msg); // Treat these messages with priority - A call to timeout means the device should lock // as soon as possible and not wait for other messages on the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); } /** Loading Loading @@ -1497,12 +1499,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { * @see #handleShow */ private void showLocked(Bundle options) { Trace.beginSection("KeyguardViewMediator#showLocked aqcuiring mShowKeyguardWakeLock"); Trace.beginSection("KeyguardViewMediator#showLocked acquiring mShowKeyguardWakeLock"); if (DEBUG) Log.d(TAG, "showLocked"); // ensure we stay awake until we are finished displaying the keyguard mShowKeyguardWakeLock.acquire(); Message msg = mHandler.obtainMessage(SHOW, options); mHandler.sendMessage(msg); // Treat these messages with priority - This call can originate from #doKeyguardTimeout, // meaning the device should lock as soon as possible and not wait for other messages on // the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); Trace.endSection(); } Loading Loading @@ -1664,6 +1669,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { case KEYGUARD_TIMEOUT: synchronized (KeyguardViewMediator.this) { doKeyguardLocked((Bundle) msg.obj); notifyDefaultDisplayCallbacks(mShowing); } break; case DISMISS: Loading Loading @@ -2293,7 +2299,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { for (int i = size - 1; i >= 0; i--) { IKeyguardStateCallback callback = mKeyguardStateCallbacks.get(i); try { callback.onShowingStateChanged(showing); callback.onShowingStateChanged(showing, KeyguardUpdateMonitor.getCurrentUser()); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged", e); if (e instanceof DeadObjectException) { Loading Loading @@ -2342,7 +2348,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { mKeyguardStateCallbacks.add(callback); try { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser()); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); Loading
services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java +6 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,12 @@ public class KeyguardServiceWrapper implements IKeyguardService { @Override // Binder interface public void doKeyguardTimeout(Bundle options) { int userId = mKeyguardStateMonitor.getCurrentUser(); if (mKeyguardStateMonitor.isSecure(userId)) { // Preemptively inform the cache that the keyguard will soon be showing, as calls to // doKeyguardTimeout are a signal to lock the device as soon as possible. mKeyguardStateMonitor.onShowingStateChanged(true, userId); } try { mService.doKeyguardTimeout(options); } catch (RemoteException e) { Loading
services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java +7 −1 Original line number Diff line number Diff line Loading @@ -83,8 +83,14 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { return mHasLockscreenWallpaper; } public int getCurrentUser() { return mCurrentUserId; } @Override // Binder interface public void onShowingStateChanged(boolean showing) { public void onShowingStateChanged(boolean showing, int userId) { if (userId != mCurrentUserId) return; mIsShowing = showing; mCallback.onShowingChanged(); Loading