diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 35ca9fa7d9dc1..fd716f341540a 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -11627,6 +11627,7 @@ package android.service.trust { method @Deprecated public final void grantTrust(CharSequence, long, boolean); method public final void grantTrust(CharSequence, long, int); method public final void isEscrowTokenActive(long, android.os.UserHandle); + method public final void lockUser(); method public final android.os.IBinder onBind(android.content.Intent); method public boolean onConfigure(java.util.List); method public void onDeviceLocked(); @@ -11637,13 +11638,16 @@ package android.service.trust { method public void onEscrowTokenStateReceived(long, int); method public void onTrustTimeout(); method public void onUnlockAttempt(boolean); + method public void onUserRequestedUnlock(); method public final void removeEscrowToken(long, android.os.UserHandle); method public final void revokeTrust(); method public final void setManagingTrust(boolean); method public final void showKeyguardErrorMessage(@NonNull CharSequence); method public final void unlockUserWithToken(long, byte[], android.os.UserHandle); field public static final int FLAG_GRANT_TRUST_DISMISS_KEYGUARD = 2; // 0x2 + field public static final int FLAG_GRANT_TRUST_DISPLAY_MESSAGE = 8; // 0x8 field public static final int FLAG_GRANT_TRUST_INITIATED_BY_USER = 1; // 0x1 + field public static final int FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE = 4; // 0x4 field public static final String SERVICE_INTERFACE = "android.service.trust.TrustAgentService"; field public static final int TOKEN_STATE_ACTIVE = 1; // 0x1 field public static final int TOKEN_STATE_INACTIVE = 0; // 0x0 diff --git a/core/java/android/service/trust/TrustAgentService.java b/core/java/android/service/trust/TrustAgentService.java index 37598512560df..8f6e1e00c3f43 100644 --- a/core/java/android/service/trust/TrustAgentService.java +++ b/core/java/android/service/trust/TrustAgentService.java @@ -119,9 +119,11 @@ public class TrustAgentService extends Service { * automatically remove trust after some conditions are met (detailed below) with the option for * the agent to renew the trust again later. * - *

After this is called, the agent will grant trust until the platform thinks an active user - * is no longer using that trust. For example, if the user dismisses keyguard, the platform will - * remove trust (this does not automatically lock the device). + *

After this is called, the agent will grant trust until the platform thinks an active + * user is no longer using that trust. This can happen for any reason as determined by the + * platform. For example, if the user dismisses keyguard, the platform will remove trust; + * since this does not automatically lock the device, this results in the device locking the + * next time the screen turns off. * *

When the platform internally removes the agent's trust in this manner, an agent can * re-grant it (via a call to grantTrust) without the user having to unlock the device through @@ -136,9 +138,6 @@ public class TrustAgentService extends Service { * Without this flag, the message passed to {@code grantTrust} is only used for debugging * purposes. With the flag, it may be displayed to the user as the reason why the device is * unlocked. - * - * TODO(b/213911325): Remove @hide - * @hide */ public static final int FLAG_GRANT_TRUST_DISPLAY_MESSAGE = 1 << 3; @@ -306,9 +305,6 @@ public class TrustAgentService extends Service { * {@link #grantTrust(CharSequence, long, int)}. * * @see #FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE - * - * TODO(b/213631672): Add CTS tests - * @hide */ public void onUserRequestedUnlock() { }