Loading core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.hardware.biometrics.BiometricSourceType; */ interface ITrustManager { void reportUnlockAttempt(boolean successful, int userId); void reportUserRequestedUnlock(int userId); void reportUnlockLockout(int timeoutMs, int userId); void reportEnabledTrustAgentsChanged(int userId); void registerTrustListener(in ITrustListener trustListener); Loading core/java/android/app/trust/TrustManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,19 @@ public class TrustManager { } } /** * Reports that the user {@code userId} is likely interested in unlocking the device. * * Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission. */ public void reportUserRequestedUnlock(int userId) { try { mService.reportUserRequestedUnlock(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Reports that user {@param userId} has entered a temporary device lockout. * Loading core/java/android/service/trust/ITrustAgentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.service.trust.ITrustAgentServiceCallback; */ interface ITrustAgentService { oneway void onUnlockAttempt(boolean successful); oneway void onUserRequestedUnlock(); oneway void onUnlockLockout(int timeoutMs); oneway void onTrustTimeout(); oneway void onDeviceLocked(); Loading core/java/android/service/trust/TrustAgentService.java +10 −1 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class TrustAgentService extends Service { private static final int MSG_ESCROW_TOKEN_ADDED = 7; private static final int MSG_ESCROW_TOKEN_STATE_RECEIVED = 8; private static final int MSG_ESCROW_TOKEN_REMOVED = 9; private static final int MSG_USER_REQUESTED_UNLOCK = 10; private static final String EXTRA_TOKEN = "token"; private static final String EXTRA_TOKEN_HANDLE = "token_handle"; Loading Loading @@ -219,6 +220,9 @@ public class TrustAgentService extends Service { case MSG_UNLOCK_ATTEMPT: onUnlockAttempt(msg.arg1 != 0); break; case MSG_USER_REQUESTED_UNLOCK: onUserRequestedUnlock(); break; case MSG_UNLOCK_LOCKOUT: onDeviceUnlockLockout(msg.arg1); break; Loading Loading @@ -306,7 +310,7 @@ public class TrustAgentService extends Service { * * @see #FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE * * TODO(b/213631672): Hook up call from system server & SystemUI, then un-hide * TODO(b/213631672): Add CTS tests * @hide */ public void onUserRequestedUnlock() { Loading Loading @@ -664,6 +668,11 @@ public class TrustAgentService extends Service { mHandler.obtainMessage(MSG_UNLOCK_ATTEMPT, successful ? 1 : 0, 0).sendToTarget(); } @Override public void onUserRequestedUnlock() { mHandler.obtainMessage(MSG_USER_REQUESTED_UNLOCK).sendToTarget(); } @Override public void onUnlockLockout(int timeoutMs) { mHandler.obtainMessage(MSG_UNLOCK_LOCKOUT, timeoutMs, 0).sendToTarget(); Loading services/core/java/com/android/server/trust/TrustAgentWrapper.java +13 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,19 @@ public class TrustAgentWrapper { } } /** * @see android.service.trust.TrustAgentService#onUserRequestedUnlock() */ public void onUserRequestedUnlock() { try { if (mTrustAgentService != null) { mTrustAgentService.onUserRequestedUnlock(); } } catch (RemoteException e) { onError(e); } } /** * @see android.service.trust.TrustAgentService#onUnlockLockout(int) */ Loading Loading
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.hardware.biometrics.BiometricSourceType; */ interface ITrustManager { void reportUnlockAttempt(boolean successful, int userId); void reportUserRequestedUnlock(int userId); void reportUnlockLockout(int timeoutMs, int userId); void reportEnabledTrustAgentsChanged(int userId); void registerTrustListener(in ITrustListener trustListener); Loading
core/java/android/app/trust/TrustManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,19 @@ public class TrustManager { } } /** * Reports that the user {@code userId} is likely interested in unlocking the device. * * Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission. */ public void reportUserRequestedUnlock(int userId) { try { mService.reportUserRequestedUnlock(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Reports that user {@param userId} has entered a temporary device lockout. * Loading
core/java/android/service/trust/ITrustAgentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.service.trust.ITrustAgentServiceCallback; */ interface ITrustAgentService { oneway void onUnlockAttempt(boolean successful); oneway void onUserRequestedUnlock(); oneway void onUnlockLockout(int timeoutMs); oneway void onTrustTimeout(); oneway void onDeviceLocked(); Loading
core/java/android/service/trust/TrustAgentService.java +10 −1 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class TrustAgentService extends Service { private static final int MSG_ESCROW_TOKEN_ADDED = 7; private static final int MSG_ESCROW_TOKEN_STATE_RECEIVED = 8; private static final int MSG_ESCROW_TOKEN_REMOVED = 9; private static final int MSG_USER_REQUESTED_UNLOCK = 10; private static final String EXTRA_TOKEN = "token"; private static final String EXTRA_TOKEN_HANDLE = "token_handle"; Loading Loading @@ -219,6 +220,9 @@ public class TrustAgentService extends Service { case MSG_UNLOCK_ATTEMPT: onUnlockAttempt(msg.arg1 != 0); break; case MSG_USER_REQUESTED_UNLOCK: onUserRequestedUnlock(); break; case MSG_UNLOCK_LOCKOUT: onDeviceUnlockLockout(msg.arg1); break; Loading Loading @@ -306,7 +310,7 @@ public class TrustAgentService extends Service { * * @see #FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE * * TODO(b/213631672): Hook up call from system server & SystemUI, then un-hide * TODO(b/213631672): Add CTS tests * @hide */ public void onUserRequestedUnlock() { Loading Loading @@ -664,6 +668,11 @@ public class TrustAgentService extends Service { mHandler.obtainMessage(MSG_UNLOCK_ATTEMPT, successful ? 1 : 0, 0).sendToTarget(); } @Override public void onUserRequestedUnlock() { mHandler.obtainMessage(MSG_USER_REQUESTED_UNLOCK).sendToTarget(); } @Override public void onUnlockLockout(int timeoutMs) { mHandler.obtainMessage(MSG_UNLOCK_LOCKOUT, timeoutMs, 0).sendToTarget(); Loading
services/core/java/com/android/server/trust/TrustAgentWrapper.java +13 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,19 @@ public class TrustAgentWrapper { } } /** * @see android.service.trust.TrustAgentService#onUserRequestedUnlock() */ public void onUserRequestedUnlock() { try { if (mTrustAgentService != null) { mTrustAgentService.onUserRequestedUnlock(); } } catch (RemoteException e) { onError(e); } } /** * @see android.service.trust.TrustAgentService#onUnlockLockout(int) */ Loading