Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28060,6 +28060,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -30043,6 +30043,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28060,6 +28060,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle); core/java/android/app/ActivityManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -3096,6 +3096,8 @@ public class ActivityManager { public static final int FLAG_OR_STOPPED = 1 << 0; /** {@hide} */ public static final int FLAG_AND_LOCKED = 1 << 1; /** {@hide} */ public static final int FLAG_AND_UNLOCKED = 1 << 2; /** * Return whether the given user is actively running. This means that Loading core/java/android/os/UserManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -754,6 +754,23 @@ public class UserManager { } } /** * Return whether the given user is running in an "unlocked" state. A user * is unlocked only after they've entered their credentials (such as a lock * pattern or PIN), and credential-encrypted private app data storage is * available. * * @param user to retrieve the unlocked state for. */ public boolean isUserRunningUnlocked(UserHandle user) { try { return ActivityManagerNative.getDefault().isUserRunning( user.getIdentifier(), ActivityManager.FLAG_AND_UNLOCKED); } catch (RemoteException e) { return false; } } /** * Returns the UserInfo object describing a specific user. * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28060,6 +28060,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle);
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -30043,6 +30043,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -28060,6 +28060,7 @@ package android.os { method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean isUserRunningUnlocked(android.os.UserHandle); method public deprecated boolean setRestrictionsChallenge(java.lang.String); method public deprecated void setUserRestriction(java.lang.String, boolean); method public deprecated void setUserRestrictions(android.os.Bundle);
core/java/android/app/ActivityManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -3096,6 +3096,8 @@ public class ActivityManager { public static final int FLAG_OR_STOPPED = 1 << 0; /** {@hide} */ public static final int FLAG_AND_LOCKED = 1 << 1; /** {@hide} */ public static final int FLAG_AND_UNLOCKED = 1 << 2; /** * Return whether the given user is actively running. This means that Loading
core/java/android/os/UserManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -754,6 +754,23 @@ public class UserManager { } } /** * Return whether the given user is running in an "unlocked" state. A user * is unlocked only after they've entered their credentials (such as a lock * pattern or PIN), and credential-encrypted private app data storage is * available. * * @param user to retrieve the unlocked state for. */ public boolean isUserRunningUnlocked(UserHandle user) { try { return ActivityManagerNative.getDefault().isUserRunning( user.getIdentifier(), ActivityManager.FLAG_AND_UNLOCKED); } catch (RemoteException e) { return false; } } /** * Returns the UserInfo object describing a specific user. * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. Loading