Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -38787,6 +38787,7 @@ package android.service.trust { method public final android.os.IBinder onBind(android.content.Intent); method public boolean onConfigure(java.util.List<android.os.PersistableBundle>); method public void onDeviceLocked(); method public void onDeviceUnlockLockout(long); method public void onDeviceUnlocked(); method public void onTrustTimeout(); method public void onUnlockAttempt(boolean); core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.app.trust.ITrustListener; */ interface ITrustManager { void reportUnlockAttempt(boolean successful, int userId); void reportUnlockLockout(int timeoutMs, int userId); void reportEnabledTrustAgentsChanged(int userId); void registerTrustListener(in ITrustListener trustListener); void unregisterTrustListener(in ITrustListener trustListener); Loading core/java/android/app/trust/TrustManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,26 @@ public class TrustManager { } } /** * Reports that user {@param userId} has entered a temporary device lockout. * * This generally occurs when the user has unsuccessfully tried to unlock the device too many * times. The user will then be unable to unlock the device until a set amount of time has * elapsed. * * @param timeout The amount of time that needs to elapse, in milliseconds, until the user may * attempt to unlock the device again. * * Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission. */ public void reportUnlockLockout(int timeoutMs, int userId) { try { mService.reportUnlockLockout(timeoutMs, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Reports that the list of enabled trust agents changed for user {@param userId}. * Loading core/java/android/service/trust/ITrustAgentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.service.trust.ITrustAgentServiceCallback; */ interface ITrustAgentService { oneway void onUnlockAttempt(boolean successful); oneway void onUnlockLockout(int timeoutMs); oneway void onTrustTimeout(); oneway void onDeviceLocked(); oneway void onDeviceUnlocked(); Loading core/java/android/service/trust/TrustAgentService.java +24 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ public class TrustAgentService extends Service { private static final int MSG_TRUST_TIMEOUT = 3; private static final int MSG_DEVICE_LOCKED = 4; private static final int MSG_DEVICE_UNLOCKED = 5; private static final int MSG_UNLOCK_LOCKOUT = 6; /** * Class containing raw data for a given configuration request. Loading Loading @@ -151,6 +152,9 @@ public class TrustAgentService extends Service { case MSG_UNLOCK_ATTEMPT: onUnlockAttempt(msg.arg1 != 0); break; case MSG_UNLOCK_LOCKOUT: onDeviceUnlockLockout(msg.arg1); break; case MSG_CONFIGURE: ConfigurationData data = (ConfigurationData) msg.obj; boolean result = onConfigure(data.options); Loading Loading @@ -226,6 +230,21 @@ public class TrustAgentService extends Service { public void onDeviceUnlocked() { } /** * Called when the device enters a temporary unlock lockout. * * <p>This occurs when the user has consecutively failed to unlock the device too many times, * and must wait until a timeout has passed to perform another attempt. The user may then only * use strong authentication mechanisms (PIN, pattern or password) to unlock the device. * Calls to {@link #grantTrust(CharSequence, long, int)} will be ignored until the user has * unlocked the device and {@link #onDeviceUnlocked()} is called. * * @param timeoutMs The amount of time, in milliseconds, that needs to elapse before the user * can attempt to unlock the device again. */ public void onDeviceUnlockLockout(long timeoutMs) { } private void onError(String msg) { Slog.v(TAG, "Remote exception while " + msg); } Loading Loading @@ -366,6 +385,11 @@ public class TrustAgentService extends Service { mHandler.obtainMessage(MSG_UNLOCK_ATTEMPT, successful ? 1 : 0, 0).sendToTarget(); } @Override public void onUnlockLockout(int timeoutMs) { mHandler.obtainMessage(MSG_UNLOCK_LOCKOUT, timeoutMs, 0).sendToTarget(); } @Override /* Binder API */ public void onTrustTimeout() { mHandler.sendEmptyMessage(MSG_TRUST_TIMEOUT); Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -38787,6 +38787,7 @@ package android.service.trust { method public final android.os.IBinder onBind(android.content.Intent); method public boolean onConfigure(java.util.List<android.os.PersistableBundle>); method public void onDeviceLocked(); method public void onDeviceUnlockLockout(long); method public void onDeviceUnlocked(); method public void onTrustTimeout(); method public void onUnlockAttempt(boolean);
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.app.trust.ITrustListener; */ interface ITrustManager { void reportUnlockAttempt(boolean successful, int userId); void reportUnlockLockout(int timeoutMs, int userId); void reportEnabledTrustAgentsChanged(int userId); void registerTrustListener(in ITrustListener trustListener); void unregisterTrustListener(in ITrustListener trustListener); Loading
core/java/android/app/trust/TrustManager.java +20 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,26 @@ public class TrustManager { } } /** * Reports that user {@param userId} has entered a temporary device lockout. * * This generally occurs when the user has unsuccessfully tried to unlock the device too many * times. The user will then be unable to unlock the device until a set amount of time has * elapsed. * * @param timeout The amount of time that needs to elapse, in milliseconds, until the user may * attempt to unlock the device again. * * Requires the {@link android.Manifest.permission#ACCESS_KEYGUARD_SECURE_STORAGE} permission. */ public void reportUnlockLockout(int timeoutMs, int userId) { try { mService.reportUnlockLockout(timeoutMs, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Reports that the list of enabled trust agents changed for user {@param userId}. * Loading
core/java/android/service/trust/ITrustAgentService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.service.trust.ITrustAgentServiceCallback; */ interface ITrustAgentService { oneway void onUnlockAttempt(boolean successful); oneway void onUnlockLockout(int timeoutMs); oneway void onTrustTimeout(); oneway void onDeviceLocked(); oneway void onDeviceUnlocked(); Loading
core/java/android/service/trust/TrustAgentService.java +24 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ public class TrustAgentService extends Service { private static final int MSG_TRUST_TIMEOUT = 3; private static final int MSG_DEVICE_LOCKED = 4; private static final int MSG_DEVICE_UNLOCKED = 5; private static final int MSG_UNLOCK_LOCKOUT = 6; /** * Class containing raw data for a given configuration request. Loading Loading @@ -151,6 +152,9 @@ public class TrustAgentService extends Service { case MSG_UNLOCK_ATTEMPT: onUnlockAttempt(msg.arg1 != 0); break; case MSG_UNLOCK_LOCKOUT: onDeviceUnlockLockout(msg.arg1); break; case MSG_CONFIGURE: ConfigurationData data = (ConfigurationData) msg.obj; boolean result = onConfigure(data.options); Loading Loading @@ -226,6 +230,21 @@ public class TrustAgentService extends Service { public void onDeviceUnlocked() { } /** * Called when the device enters a temporary unlock lockout. * * <p>This occurs when the user has consecutively failed to unlock the device too many times, * and must wait until a timeout has passed to perform another attempt. The user may then only * use strong authentication mechanisms (PIN, pattern or password) to unlock the device. * Calls to {@link #grantTrust(CharSequence, long, int)} will be ignored until the user has * unlocked the device and {@link #onDeviceUnlocked()} is called. * * @param timeoutMs The amount of time, in milliseconds, that needs to elapse before the user * can attempt to unlock the device again. */ public void onDeviceUnlockLockout(long timeoutMs) { } private void onError(String msg) { Slog.v(TAG, "Remote exception while " + msg); } Loading Loading @@ -366,6 +385,11 @@ public class TrustAgentService extends Service { mHandler.obtainMessage(MSG_UNLOCK_ATTEMPT, successful ? 1 : 0, 0).sendToTarget(); } @Override public void onUnlockLockout(int timeoutMs) { mHandler.obtainMessage(MSG_UNLOCK_LOCKOUT, timeoutMs, 0).sendToTarget(); } @Override /* Binder API */ public void onTrustTimeout() { mHandler.sendEmptyMessage(MSG_TRUST_TIMEOUT); Loading