Loading core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,5 @@ interface ITrustManager { void setDeviceLockedForUser(int userId, boolean locked); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); boolean isTrustUsuallyManaged(int userId); } core/java/android/app/trust/TrustManager.java +17 −6 Original line number Diff line number Diff line Loading @@ -16,21 +16,17 @@ package android.app.trust; import com.android.internal.widget.LockPatternUtils; import android.Manifest; import android.annotation.IntDef; import android.annotation.RequiresPermission; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.util.ArrayMap; import android.util.Log; import android.util.SparseIntArray; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * See {@link com.android.server.trust.TrustManagerService} Loading Loading @@ -158,6 +154,21 @@ public class TrustManager { } } /** * @return whether {@userId} has enabled and configured trust agents. Ignores short-term * unavailability of trust due to {@link LockPatternUtils.StrongAuthTracker}. */ @RequiresPermission(android.Manifest.permission.TRUST_LISTENER) public boolean isTrustUsuallyManaged(int userId) { try { return mService.isTrustUsuallyManaged(userId); } catch (RemoteException e) { return false; } } private void onError(Exception e) { Log.e(TAG, "Error while calling TrustManagerService", e); } Loading core/java/com/android/internal/widget/LockPatternUtils.java +25 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class LockPatternUtils { private static final String LOCK_SCREEN_DEVICE_OWNER_INFO = "lockscreen.device_owner_info"; private static final String ENABLED_TRUST_AGENTS = "lockscreen.enabledtrustagents"; private static final String IS_TRUST_USUALLY_MANAGED = "lockscreen.istrustusuallymanaged"; private static final String SEPARATE_PROFILE_CHALLENGE_KEY = "lockscreen.profilechallenge"; Loading @@ -149,6 +150,30 @@ public class LockPatternUtils { private ILockSettings mLockSettingsService; private UserManager mUserManager; /** * Use {@link TrustManager#isTrustUsuallyManaged(int)}. * * This returns the lazily-peristed value and should only be used by TrustManagerService. */ public boolean isTrustUsuallyManaged(int userId) { if (!(mLockSettingsService instanceof ILockSettings.Stub)) { throw new IllegalStateException("May only be called by TrustManagerService. " + "Use TrustManager.isTrustUsuallyManaged()"); } try { return getLockSettings().getBoolean(IS_TRUST_USUALLY_MANAGED, false, userId); } catch (RemoteException e) { return false; } } public void setTrustUsuallyManaged(boolean managed, int userId) { try { getLockSettings().setBoolean(IS_TRUST_USUALLY_MANAGED, managed, userId); } catch (RemoteException e) { // System dead. } } public static final class RequestThrottledException extends Exception { private int mTimeoutMs; Loading packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java +3 −1 Original line number Diff line number Diff line Loading @@ -117,8 +117,10 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView return R.string.kg_prompt_reason_restart_password; case PROMPT_REASON_TIMEOUT: return R.string.kg_prompt_reason_timeout_password; default: case PROMPT_REASON_NONE: return 0; default: return R.string.kg_prompt_reason_timeout_password; } } Loading packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java +4 −0 Original line number Diff line number Diff line Loading @@ -339,7 +339,11 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mSecurityMessageDisplay.setMessage(R.string.kg_prompt_reason_timeout_pattern, true /* important */); break; case PROMPT_REASON_NONE: break; default: mSecurityMessageDisplay.setMessage(R.string.kg_prompt_reason_timeout_pattern, true /* important */); break; } } Loading Loading
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,5 @@ interface ITrustManager { void setDeviceLockedForUser(int userId, boolean locked); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); boolean isTrustUsuallyManaged(int userId); }
core/java/android/app/trust/TrustManager.java +17 −6 Original line number Diff line number Diff line Loading @@ -16,21 +16,17 @@ package android.app.trust; import com.android.internal.widget.LockPatternUtils; import android.Manifest; import android.annotation.IntDef; import android.annotation.RequiresPermission; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.util.ArrayMap; import android.util.Log; import android.util.SparseIntArray; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * See {@link com.android.server.trust.TrustManagerService} Loading Loading @@ -158,6 +154,21 @@ public class TrustManager { } } /** * @return whether {@userId} has enabled and configured trust agents. Ignores short-term * unavailability of trust due to {@link LockPatternUtils.StrongAuthTracker}. */ @RequiresPermission(android.Manifest.permission.TRUST_LISTENER) public boolean isTrustUsuallyManaged(int userId) { try { return mService.isTrustUsuallyManaged(userId); } catch (RemoteException e) { return false; } } private void onError(Exception e) { Log.e(TAG, "Error while calling TrustManagerService", e); } Loading
core/java/com/android/internal/widget/LockPatternUtils.java +25 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class LockPatternUtils { private static final String LOCK_SCREEN_DEVICE_OWNER_INFO = "lockscreen.device_owner_info"; private static final String ENABLED_TRUST_AGENTS = "lockscreen.enabledtrustagents"; private static final String IS_TRUST_USUALLY_MANAGED = "lockscreen.istrustusuallymanaged"; private static final String SEPARATE_PROFILE_CHALLENGE_KEY = "lockscreen.profilechallenge"; Loading @@ -149,6 +150,30 @@ public class LockPatternUtils { private ILockSettings mLockSettingsService; private UserManager mUserManager; /** * Use {@link TrustManager#isTrustUsuallyManaged(int)}. * * This returns the lazily-peristed value and should only be used by TrustManagerService. */ public boolean isTrustUsuallyManaged(int userId) { if (!(mLockSettingsService instanceof ILockSettings.Stub)) { throw new IllegalStateException("May only be called by TrustManagerService. " + "Use TrustManager.isTrustUsuallyManaged()"); } try { return getLockSettings().getBoolean(IS_TRUST_USUALLY_MANAGED, false, userId); } catch (RemoteException e) { return false; } } public void setTrustUsuallyManaged(boolean managed, int userId) { try { getLockSettings().setBoolean(IS_TRUST_USUALLY_MANAGED, managed, userId); } catch (RemoteException e) { // System dead. } } public static final class RequestThrottledException extends Exception { private int mTimeoutMs; Loading
packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java +3 −1 Original line number Diff line number Diff line Loading @@ -117,8 +117,10 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView return R.string.kg_prompt_reason_restart_password; case PROMPT_REASON_TIMEOUT: return R.string.kg_prompt_reason_timeout_password; default: case PROMPT_REASON_NONE: return 0; default: return R.string.kg_prompt_reason_timeout_password; } } Loading
packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java +4 −0 Original line number Diff line number Diff line Loading @@ -339,7 +339,11 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mSecurityMessageDisplay.setMessage(R.string.kg_prompt_reason_timeout_pattern, true /* important */); break; case PROMPT_REASON_NONE: break; default: mSecurityMessageDisplay.setMessage(R.string.kg_prompt_reason_timeout_pattern, true /* important */); break; } } Loading