Loading core/java/android/app/trust/ITrustListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,5 @@ oneway interface ITrustListener { in List<String> trustGrantedMessages); void onTrustManagedChanged(boolean managed, int userId); void onTrustError(in CharSequence message); void onIsActiveUnlockRunningChanged(boolean isRunning, int userId); } core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -40,4 +40,5 @@ interface ITrustManager { boolean isTrustUsuallyManaged(int userId); void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); boolean isActiveUnlockRunning(int userId); } core/java/android/app/trust/TrustManager.java +29 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class TrustManager { private static final int MSG_TRUST_MANAGED_CHANGED = 2; private static final int MSG_TRUST_ERROR = 3; private static final int MSG_ENABLED_TRUST_AGENTS_CHANGED = 4; private static final int MSG_IS_ACTIVE_UNLOCK_RUNNING = 5; private static final String TAG = "TrustManager"; private static final String DATA_FLAGS = "initiatedByUser"; Loading Loading @@ -165,6 +166,17 @@ public class TrustManager { } } /** * Returns whether active unlock can be used to unlock the device for user {@code userId}. */ public boolean isActiveUnlockRunning(int userId) { try { return mService.isActiveUnlockRunning(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Registers a listener for trust events. * Loading Loading @@ -206,6 +218,12 @@ public class TrustManager { m.getData().putCharSequence(DATA_MESSAGE, message); m.sendToTarget(); } @Override public void onIsActiveUnlockRunningChanged(boolean isRunning, int userId) { mHandler.obtainMessage(MSG_IS_ACTIVE_UNLOCK_RUNNING, (isRunning ? 1 : 0), userId, trustListener).sendToTarget(); } }; mService.registerTrustListener(iTrustListener); mTrustListeners.put(trustListener, iTrustListener); Loading Loading @@ -295,6 +313,10 @@ public class TrustManager { case MSG_ENABLED_TRUST_AGENTS_CHANGED: ((TrustListener) msg.obj).onEnabledTrustAgentsChanged(msg.arg1); break; case MSG_IS_ACTIVE_UNLOCK_RUNNING: ((TrustListener) msg.obj) .onIsActiveUnlockRunningChanged(msg.arg1 != 0, msg.arg2); break; } } }; Loading Loading @@ -333,5 +355,12 @@ public class TrustManager { * Reports that the enabled trust agents for the specified user has changed. */ void onEnabledTrustAgentsChanged(int userId); /** * Reports changes on if the device can be unlocked with active unlock. * @param isRunning If true, the device can be unlocked with active unlock. * @param userId The user, for which the state changed. */ void onIsActiveUnlockRunningChanged(boolean isRunning, int userId); } } packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } @Override public void onIsActiveUnlockRunningChanged(boolean isRunning, int userId) { } /** * Whether the trust granted call with its passed flags should dismiss keyguard. * It's assumed that the trust was granted for the current user. Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,11 @@ constructor( "onTrustManagedChanged" ) } override fun onIsActiveUnlockRunningChanged( isRunning: Boolean, userId: Int ) = Unit } trustManager.registerTrustListener(callback) logger.trustListenerRegistered() Loading Loading
core/java/android/app/trust/ITrustListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,5 @@ oneway interface ITrustListener { in List<String> trustGrantedMessages); void onTrustManagedChanged(boolean managed, int userId); void onTrustError(in CharSequence message); void onIsActiveUnlockRunningChanged(boolean isRunning, int userId); }
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -40,4 +40,5 @@ interface ITrustManager { boolean isTrustUsuallyManaged(int userId); void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); boolean isActiveUnlockRunning(int userId); }
core/java/android/app/trust/TrustManager.java +29 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class TrustManager { private static final int MSG_TRUST_MANAGED_CHANGED = 2; private static final int MSG_TRUST_ERROR = 3; private static final int MSG_ENABLED_TRUST_AGENTS_CHANGED = 4; private static final int MSG_IS_ACTIVE_UNLOCK_RUNNING = 5; private static final String TAG = "TrustManager"; private static final String DATA_FLAGS = "initiatedByUser"; Loading Loading @@ -165,6 +166,17 @@ public class TrustManager { } } /** * Returns whether active unlock can be used to unlock the device for user {@code userId}. */ public boolean isActiveUnlockRunning(int userId) { try { return mService.isActiveUnlockRunning(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Registers a listener for trust events. * Loading Loading @@ -206,6 +218,12 @@ public class TrustManager { m.getData().putCharSequence(DATA_MESSAGE, message); m.sendToTarget(); } @Override public void onIsActiveUnlockRunningChanged(boolean isRunning, int userId) { mHandler.obtainMessage(MSG_IS_ACTIVE_UNLOCK_RUNNING, (isRunning ? 1 : 0), userId, trustListener).sendToTarget(); } }; mService.registerTrustListener(iTrustListener); mTrustListeners.put(trustListener, iTrustListener); Loading Loading @@ -295,6 +313,10 @@ public class TrustManager { case MSG_ENABLED_TRUST_AGENTS_CHANGED: ((TrustListener) msg.obj).onEnabledTrustAgentsChanged(msg.arg1); break; case MSG_IS_ACTIVE_UNLOCK_RUNNING: ((TrustListener) msg.obj) .onIsActiveUnlockRunningChanged(msg.arg1 != 0, msg.arg2); break; } } }; Loading Loading @@ -333,5 +355,12 @@ public class TrustManager { * Reports that the enabled trust agents for the specified user has changed. */ void onEnabledTrustAgentsChanged(int userId); /** * Reports changes on if the device can be unlocked with active unlock. * @param isRunning If true, the device can be unlocked with active unlock. * @param userId The user, for which the state changed. */ void onIsActiveUnlockRunningChanged(boolean isRunning, int userId); } }
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -570,6 +570,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } @Override public void onIsActiveUnlockRunningChanged(boolean isRunning, int userId) { } /** * Whether the trust granted call with its passed flags should dismiss keyguard. * It's assumed that the trust was granted for the current user. Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,11 @@ constructor( "onTrustManagedChanged" ) } override fun onIsActiveUnlockRunningChanged( isRunning: Boolean, userId: Int ) = Unit } trustManager.registerTrustListener(callback) logger.trustListenerRegistered() Loading