Loading api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4596,6 +4596,7 @@ package android.app { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); method public boolean isDeviceLocked(); method public boolean isDeviceSecure(); method public boolean isKeyguardLocked(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); method public boolean isKeyguardSecure(); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4687,6 +4687,7 @@ package android.app { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); method public boolean isDeviceLocked(); method public boolean isDeviceSecure(); method public boolean isKeyguardLocked(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); method public boolean isKeyguardSecure(); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); core/java/android/app/KeyguardManager.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -252,6 +252,32 @@ public class KeyguardManager { } } } } /** * Returns whether the device is secured with a PIN, pattern or * password. * * @return true if a PIN, pattern or password was set. */ public boolean isDeviceSecure() { return isDeviceSecure(UserHandle.getCallingUserId()); } /** * Returns whether the device is secured with a PIN, pattern or * password. * * @param userId the user for which the secure state should be reported. * @return true if a PIN, pattern or password was set. * @hide */ public boolean isDeviceSecure(int userId) { try { return mTrustManager.isDeviceSecure(userId); } catch (RemoteException e) { return false; } } /** /** * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} Loading core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -31,4 +31,5 @@ interface ITrustManager { void unregisterTrustListener(in ITrustListener trustListener); void unregisterTrustListener(in ITrustListener trustListener); void reportKeyguardShowingChanged(); void reportKeyguardShowingChanged(); boolean isDeviceLocked(int userId); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); } } services/core/java/com/android/server/trust/TrustManagerService.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -691,6 +691,20 @@ public class TrustManagerService extends SystemService { return isDeviceLockedInner(userId); return isDeviceLockedInner(userId); } } @Override public boolean isDeviceSecure(int userId) throws RemoteException { userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId, false /* allowAll */, true /* requireFull */, "isDeviceSecure", null); userId = resolveProfileParent(userId); long token = Binder.clearCallingIdentity(); try { return new LockPatternUtils(mContext).isSecure(userId); } finally { Binder.restoreCallingIdentity(token); } } private void enforceReportPermission() { private void enforceReportPermission() { mContext.enforceCallingOrSelfPermission( mContext.enforceCallingOrSelfPermission( Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Loading Loading
api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4596,6 +4596,7 @@ package android.app { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); method public boolean isDeviceLocked(); method public boolean isDeviceSecure(); method public boolean isKeyguardLocked(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); method public boolean isKeyguardSecure(); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4687,6 +4687,7 @@ package android.app { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); method public boolean isDeviceLocked(); method public boolean isDeviceSecure(); method public boolean isKeyguardLocked(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); method public boolean isKeyguardSecure(); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String); method public deprecated android.app.KeyguardManager.KeyguardLock newKeyguardLock(java.lang.String);
core/java/android/app/KeyguardManager.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -252,6 +252,32 @@ public class KeyguardManager { } } } } /** * Returns whether the device is secured with a PIN, pattern or * password. * * @return true if a PIN, pattern or password was set. */ public boolean isDeviceSecure() { return isDeviceSecure(UserHandle.getCallingUserId()); } /** * Returns whether the device is secured with a PIN, pattern or * password. * * @param userId the user for which the secure state should be reported. * @return true if a PIN, pattern or password was set. * @hide */ public boolean isDeviceSecure(int userId) { try { return mTrustManager.isDeviceSecure(userId); } catch (RemoteException e) { return false; } } /** /** * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} Loading
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -31,4 +31,5 @@ interface ITrustManager { void unregisterTrustListener(in ITrustListener trustListener); void unregisterTrustListener(in ITrustListener trustListener); void reportKeyguardShowingChanged(); void reportKeyguardShowingChanged(); boolean isDeviceLocked(int userId); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); } }
services/core/java/com/android/server/trust/TrustManagerService.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -691,6 +691,20 @@ public class TrustManagerService extends SystemService { return isDeviceLockedInner(userId); return isDeviceLockedInner(userId); } } @Override public boolean isDeviceSecure(int userId) throws RemoteException { userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId, false /* allowAll */, true /* requireFull */, "isDeviceSecure", null); userId = resolveProfileParent(userId); long token = Binder.clearCallingIdentity(); try { return new LockPatternUtils(mContext).isSecure(userId); } finally { Binder.restoreCallingIdentity(token); } } private void enforceReportPermission() { private void enforceReportPermission() { mContext.enforceCallingOrSelfPermission( mContext.enforceCallingOrSelfPermission( Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Loading