Loading core/java/android/app/trust/ITrustListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import java.util.List; * {@hide} */ oneway interface ITrustListener { void onEnabledTrustAgentsChanged(int userId); void onTrustChanged(boolean enabled, boolean newlyUnlocked, int userId, int flags, in List<String> trustGrantedMessages); void onTrustManagedChanged(boolean managed, int userId); Loading core/java/android/app/trust/TrustManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class TrustManager { private static final int MSG_TRUST_CHANGED = 1; 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 String TAG = "TrustManager"; private static final String DATA_FLAGS = "initiatedByUser"; Loading Loading @@ -186,6 +187,13 @@ public class TrustManager { m.sendToTarget(); } @Override public void onEnabledTrustAgentsChanged(int userId) { final Message m = mHandler.obtainMessage(MSG_ENABLED_TRUST_AGENTS_CHANGED, userId, 0, trustListener); m.sendToTarget(); } @Override public void onTrustManagedChanged(boolean managed, int userId) { mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId, Loading Loading @@ -283,6 +291,10 @@ public class TrustManager { case MSG_TRUST_ERROR: final CharSequence message = msg.peekData().getCharSequence(DATA_MESSAGE); ((TrustListener) msg.obj).onTrustError(message); break; case MSG_ENABLED_TRUST_AGENTS_CHANGED: ((TrustListener) msg.obj).onEnabledTrustAgentsChanged(msg.arg1); break; } } }; Loading Loading @@ -316,5 +328,10 @@ public class TrustManager { * @param message A message that should be displayed on the UI. */ void onTrustError(CharSequence message); /** * Reports that the enabled trust agents for the specified user has changed. */ void onEnabledTrustAgentsChanged(int userId); } } packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +12 −0 Original line number Diff line number Diff line Loading @@ -549,6 +549,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab dispatchErrorMessage(message); } @Override public void onEnabledTrustAgentsChanged(int userId) { Assert.isMainThread(); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onEnabledTrustAgentsChanged(userId); } } } private void handleSimSubscriptionInfoChanged() { Assert.isMainThread(); mLogger.v("onSubscriptionInfoChanged()"); Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -322,4 +322,9 @@ public class KeyguardUpdateMonitorCallback { * Called when keyguard is going away or not going away. */ public void onKeyguardGoingAway() { } /** * Called when the enabled trust agents associated with the specified user. */ public void onEnabledTrustAgentsChanged(int userId) { } } packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ constructor( override fun onTrustError(message: CharSequence?) = Unit override fun onTrustManagedChanged(enabled: Boolean, userId: Int) = Unit override fun onEnabledTrustAgentsChanged(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 @@ -24,6 +24,7 @@ import java.util.List; * {@hide} */ oneway interface ITrustListener { void onEnabledTrustAgentsChanged(int userId); void onTrustChanged(boolean enabled, boolean newlyUnlocked, int userId, int flags, in List<String> trustGrantedMessages); void onTrustManagedChanged(boolean managed, int userId); Loading
core/java/android/app/trust/TrustManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class TrustManager { private static final int MSG_TRUST_CHANGED = 1; 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 String TAG = "TrustManager"; private static final String DATA_FLAGS = "initiatedByUser"; Loading Loading @@ -186,6 +187,13 @@ public class TrustManager { m.sendToTarget(); } @Override public void onEnabledTrustAgentsChanged(int userId) { final Message m = mHandler.obtainMessage(MSG_ENABLED_TRUST_AGENTS_CHANGED, userId, 0, trustListener); m.sendToTarget(); } @Override public void onTrustManagedChanged(boolean managed, int userId) { mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId, Loading Loading @@ -283,6 +291,10 @@ public class TrustManager { case MSG_TRUST_ERROR: final CharSequence message = msg.peekData().getCharSequence(DATA_MESSAGE); ((TrustListener) msg.obj).onTrustError(message); break; case MSG_ENABLED_TRUST_AGENTS_CHANGED: ((TrustListener) msg.obj).onEnabledTrustAgentsChanged(msg.arg1); break; } } }; Loading Loading @@ -316,5 +328,10 @@ public class TrustManager { * @param message A message that should be displayed on the UI. */ void onTrustError(CharSequence message); /** * Reports that the enabled trust agents for the specified user has changed. */ void onEnabledTrustAgentsChanged(int userId); } }
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +12 −0 Original line number Diff line number Diff line Loading @@ -549,6 +549,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab dispatchErrorMessage(message); } @Override public void onEnabledTrustAgentsChanged(int userId) { Assert.isMainThread(); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onEnabledTrustAgentsChanged(userId); } } } private void handleSimSubscriptionInfoChanged() { Assert.isMainThread(); mLogger.v("onSubscriptionInfoChanged()"); Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -322,4 +322,9 @@ public class KeyguardUpdateMonitorCallback { * Called when keyguard is going away or not going away. */ public void onKeyguardGoingAway() { } /** * Called when the enabled trust agents associated with the specified user. */ public void onEnabledTrustAgentsChanged(int userId) { } }
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ constructor( override fun onTrustError(message: CharSequence?) = Unit override fun onTrustManagedChanged(enabled: Boolean, userId: Int) = Unit override fun onEnabledTrustAgentsChanged(userId: Int) = Unit } trustManager.registerTrustListener(callback) logger.trustListenerRegistered() Loading