Loading packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> private final KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override public void onTrustGrantedWithFlags(int flags, int userId) { public void onTrustGrantedWithFlags(int flags, int userId, String message) { if (userId != KeyguardUpdateMonitor.getCurrentUser()) return; boolean bouncerVisible = mView.isVisibleToUser(); boolean temporaryAndRenewable = Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +12 −20 Original line number Diff line number Diff line Loading @@ -486,19 +486,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab FACE_AUTH_TRIGGERED_TRUST_DISABLED); } mLogger.logTrustChanged(wasTrusted, enabled, userId); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onTrustChanged(userId); if (enabled && flags != 0) { cb.onTrustGrantedWithFlags(flags, userId); } } } String message = null; if (KeyguardUpdateMonitor.getCurrentUser() == userId) { CharSequence message = null; final boolean userHasTrust = getUserHasTrust(userId); if (userHasTrust && trustGrantedMessages != null) { for (String msg : trustGrantedMessages) { Loading @@ -508,14 +497,17 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } } } mLogger.logTrustChanged(wasTrusted, enabled, userId); if (message != null) { mLogger.logShowTrustGrantedMessage(message.toString()); } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.showTrustGrantedMessage(message); cb.onTrustChanged(userId); if (enabled) { cb.onTrustGrantedWithFlags(flags, userId, message); } } } Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −7 Original line number Diff line number Diff line Loading @@ -174,14 +174,12 @@ public class KeyguardUpdateMonitorCallback { public void onTrustManagedChanged(int userId) { } /** * Called after trust was granted with non-zero flags. * Called after trust was granted. * @param userId of the user that has been granted trust * @param message optional message the trust agent has provided to show that should indicate * why trust was granted. */ public void onTrustGrantedWithFlags(int flags, int userId) { } /** * Called when setting the trust granted message. */ public void showTrustGrantedMessage(@Nullable CharSequence message) { } public void onTrustGrantedWithFlags(int flags, int userId, @Nullable String message) { } /** * Called when a biometric has been acquired. Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +13 −6 Original line number Diff line number Diff line Loading @@ -1179,16 +1179,14 @@ public class KeyguardIndicationController { @Override public void onTrustChanged(int userId) { if (getCurrentUser() != userId) { return; } if (!isCurrentUser(userId)) return; updateDeviceEntryIndication(false); } @Override public void showTrustGrantedMessage(CharSequence message) { mTrustGrantedIndication = message; updateDeviceEntryIndication(false); public void onTrustGrantedWithFlags(int flags, int userId, @Nullable String message) { if (!isCurrentUser(userId)) return; showTrustGrantedMessage(flags, message); } @Override Loading Loading @@ -1248,6 +1246,15 @@ public class KeyguardIndicationController { } } private boolean isCurrentUser(int userId) { return getCurrentUser() == userId; } void showTrustGrantedMessage(int flags, @Nullable CharSequence message) { mTrustGrantedIndication = message; updateDeviceEntryIndication(false); } private void handleFaceLockoutError(String errString) { int followupMsgId = canUnlockWithFingerprint() ? R.string.keyguard_suggest_fingerprint : R.string.keyguard_unlock; Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -1314,7 +1314,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { Arrays.asList("Unlocked by wearable")); // THEN the showTrustGrantedMessage should be called with the first message verify(mTestCallback).showTrustGrantedMessage("Unlocked by wearable"); verify(mTestCallback).onTrustGrantedWithFlags( eq(0), eq(KeyguardUpdateMonitor.getCurrentUser()), eq("Unlocked by wearable")); } @Test Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> private final KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override public void onTrustGrantedWithFlags(int flags, int userId) { public void onTrustGrantedWithFlags(int flags, int userId, String message) { if (userId != KeyguardUpdateMonitor.getCurrentUser()) return; boolean bouncerVisible = mView.isVisibleToUser(); boolean temporaryAndRenewable = Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +12 −20 Original line number Diff line number Diff line Loading @@ -486,19 +486,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab FACE_AUTH_TRIGGERED_TRUST_DISABLED); } mLogger.logTrustChanged(wasTrusted, enabled, userId); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onTrustChanged(userId); if (enabled && flags != 0) { cb.onTrustGrantedWithFlags(flags, userId); } } } String message = null; if (KeyguardUpdateMonitor.getCurrentUser() == userId) { CharSequence message = null; final boolean userHasTrust = getUserHasTrust(userId); if (userHasTrust && trustGrantedMessages != null) { for (String msg : trustGrantedMessages) { Loading @@ -508,14 +497,17 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } } } mLogger.logTrustChanged(wasTrusted, enabled, userId); if (message != null) { mLogger.logShowTrustGrantedMessage(message.toString()); } for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.showTrustGrantedMessage(message); cb.onTrustChanged(userId); if (enabled) { cb.onTrustGrantedWithFlags(flags, userId, message); } } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −7 Original line number Diff line number Diff line Loading @@ -174,14 +174,12 @@ public class KeyguardUpdateMonitorCallback { public void onTrustManagedChanged(int userId) { } /** * Called after trust was granted with non-zero flags. * Called after trust was granted. * @param userId of the user that has been granted trust * @param message optional message the trust agent has provided to show that should indicate * why trust was granted. */ public void onTrustGrantedWithFlags(int flags, int userId) { } /** * Called when setting the trust granted message. */ public void showTrustGrantedMessage(@Nullable CharSequence message) { } public void onTrustGrantedWithFlags(int flags, int userId, @Nullable String message) { } /** * Called when a biometric has been acquired. Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +13 −6 Original line number Diff line number Diff line Loading @@ -1179,16 +1179,14 @@ public class KeyguardIndicationController { @Override public void onTrustChanged(int userId) { if (getCurrentUser() != userId) { return; } if (!isCurrentUser(userId)) return; updateDeviceEntryIndication(false); } @Override public void showTrustGrantedMessage(CharSequence message) { mTrustGrantedIndication = message; updateDeviceEntryIndication(false); public void onTrustGrantedWithFlags(int flags, int userId, @Nullable String message) { if (!isCurrentUser(userId)) return; showTrustGrantedMessage(flags, message); } @Override Loading Loading @@ -1248,6 +1246,15 @@ public class KeyguardIndicationController { } } private boolean isCurrentUser(int userId) { return getCurrentUser() == userId; } void showTrustGrantedMessage(int flags, @Nullable CharSequence message) { mTrustGrantedIndication = message; updateDeviceEntryIndication(false); } private void handleFaceLockoutError(String errString) { int followupMsgId = canUnlockWithFingerprint() ? R.string.keyguard_suggest_fingerprint : R.string.keyguard_unlock; Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -1314,7 +1314,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { Arrays.asList("Unlocked by wearable")); // THEN the showTrustGrantedMessage should be called with the first message verify(mTestCallback).showTrustGrantedMessage("Unlocked by wearable"); verify(mTestCallback).onTrustGrantedWithFlags( eq(0), eq(KeyguardUpdateMonitor.getCurrentUser()), eq("Unlocked by wearable")); } @Test Loading