diff options
Diffstat (limited to 'core/java/android/app/ActivityManager.java')
-rw-r--r-- | core/java/android/app/ActivityManager.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index cd22aad..bb3c56a 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -1957,4 +1957,21 @@ public class ActivityManager { return false; } } + + /** + * Return whether the given user is actively running. This means that + * the user is in the "started" state, not "stopped" -- it is currently + * allowed to run code through scheduled alarms, receiving broadcasts, + * etc. A started user may be either the current foreground user or a + * background user; the result here does not distinguish between the two. + * @param userid the user's id. Zero indicates the default user. + * @hide + */ + public boolean isUserRunning(int userid) { + try { + return ActivityManagerNative.getDefault().isUserRunning(userid); + } catch (RemoteException e) { + return false; + } + } } |