diff options
| author | Dianne Hackborn <hackbod@google.com> | 2015-07-01 15:05:04 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2015-07-01 15:05:04 -0700 |
| commit | 3b16cf4f47142a845bf0ede54ef8ef956506c6c3 (patch) | |
| tree | 5f1ae1b8de0e604078af0ea8a360d217b16bce6b /core/java/android/os/UserHandle.java | |
| parent | 80abf887a1578669d3167ea83d52a497a64ea491 (diff) | |
Device idle fixes: issue #22209630 and issue #22225665
Issue #22209630: Only allow whitelisted apps to put apps on the temp whitelist
We now check whether the calling app is a system uid or in the whitelist
and, if not, throw an exception.
Issue #22225665: Alarm still goes off in idle mode (doze)
Fix a bug where we were not clearing the calling identity when coming
through the dump command to the service, and as a result when we would
eventually call out to the alarm manager it wouldn't do what we want.
This was only broken when being controlled by the shell.
Also adjust the network policy manager service's handling of device
idle transitions to only toggle the device idle state, which gets rid
of the long delay we have coming out of idle mode. And add in a bit
of logging around going in/out of idle mode to try to understand where
things may be slow in the future.
Change-Id: I4a41f790e9b0bb31330314b94111557d479f2ba5
Diffstat (limited to 'core/java/android/os/UserHandle.java')
| -rw-r--r-- | core/java/android/os/UserHandle.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java index 511bd5f4f6c7..20bcf62a42e6 100644 --- a/core/java/android/os/UserHandle.java +++ b/core/java/android/os/UserHandle.java @@ -221,6 +221,17 @@ public final class UserHandle implements Parcelable { * components -- user, app, isolated, etc. * @hide */ + public static String formatUid(int uid) { + StringBuilder sb = new StringBuilder(); + formatUid(sb, uid); + return sb.toString(); + } + + /** + * Generate a text representation of the uid, breaking out its individual + * components -- user, app, isolated, etc. + * @hide + */ public static void formatUid(PrintWriter pw, int uid) { if (uid < Process.FIRST_APPLICATION_UID) { pw.print(uid); |
