Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4dfbdc5 authored by Eric Laurent's avatar Eric Laurent
Browse files

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
parent bad5d694
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
    }