diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-03-25 14:41:05 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2014-04-03 11:20:15 -0700 |
commit | ef640cdfb29caf9d0abf4aba020afbc3eb3e0443 (patch) | |
tree | 650a0d9c00e4bca604a44bd9557e5f94b9da47c5 /services | |
parent | 9316082809196acd126a1e502d4b26d7b5f98216 (diff) | |
download | frameworks_base-ef640cdfb29caf9d0abf4aba020afbc3eb3e0443.zip frameworks_base-ef640cdfb29caf9d0abf4aba020afbc3eb3e0443.tar.gz frameworks_base-ef640cdfb29caf9d0abf4aba020afbc3eb3e0443.tar.bz2 |
Don't allow -1 uids for wake locks.
Change-Id: Ia1b412a166f69247be3b047138349e7b4031bd7d
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/power/PowerManagerService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index a388318..80c3c8e 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -2541,6 +2541,9 @@ public final class PowerManagerService extends com.android.server.SystemService @Override // Binder call public void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName, int uid) { + if (uid < 0) { + uid = Binder.getCallingUid(); + } acquireWakeLock(lock, flags, tag, packageName, new WorkSource(uid), null); } |