summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-10-01 11:53:51 -0700
committerEric Laurent <elaurent@google.com>2013-10-01 12:02:10 -0700
commita4dfbdc54d8898491d3a7d1d9d818c7db3fd773d (patch)
tree9e7eae68d0448d2e7858dbd9f39fd84f64f242e6 /media
parentbad5d694c7d7ae27ca966d6da059f81c5d964748 (diff)
downloadframeworks_base-a4dfbdc54d8898491d3a7d1d9d818c7db3fd773d.zip
frameworks_base-a4dfbdc54d8898491d3a7d1d9d818c7db3fd773d.tar.gz
frameworks_base-a4dfbdc54d8898491d3a7d1d9d818c7db3fd773d.tar.bz2
audioservice: always acquire wake lock as AudioService
When a wake lock is aquired while executing a binder call and released in the message handler, AppOps complains about the uid mismatch. Clear the binder identity before acquiring the wake lock. Bug: 10627124. Change-Id: Ibd5babc1ae699bffde1a659562089eb091879106
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 3425c91..84ea4c9 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -2687,7 +2687,11 @@ public class AudioService extends IAudioService.Stub {
*/
private void queueMsgUnderWakeLock(Handler handler, int msg,
int arg1, int arg2, Object obj, int delay) {
+ final long ident = Binder.clearCallingIdentity();
+ // Always acquire the wake lock as AudioService because it is released by the
+ // message handler.
mAudioEventWakeLock.acquire();
+ Binder.restoreCallingIdentity(ident);
sendMsg(handler, msg, SENDMSG_QUEUE, arg1, arg2, obj, delay);
}