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

Commit 40f21b72 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by android-build-merger
Browse files

Merge "Fix issue #63971747: Audio is not heard first time when played after a...

Merge "Fix issue #63971747: Audio is not heard first time when played after a long pause" into oc-mr1-dev
am: d9d208a6

Change-Id: I98836388ee501bb44c1ed60925d8846dbbe7d4ae
parents f9ddd978 d9d208a6
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -801,6 +801,16 @@ public class AudioService extends IAudioService.Stub
    public void systemReady() {
        sendMsg(mAudioHandler, MSG_SYSTEM_READY, SENDMSG_QUEUE,
                0, 0, null, 0);
        if (false) {
            // This is turned off for now, because it is racy and thus causes apps to break.
            // Currently banning a uid means that if an app tries to start playing an audio
            // stream, that will be preventing, and unbanning it will not allow that stream
            // to resume.  However these changes in uid state are racy with what the app is doing,
            // so that after taking a process out of the cached state we can't guarantee that
            // we will unban the uid before the app actually tries to start playing audio.
            // (To do that, the activity manager would need to wait until it knows for sure
            // that the ban has been removed, before telling the app to do whatever it is
            // supposed to do that caused it to go out of the cached state.)
            try {
                ActivityManager.getService().registerUidObserver(mUidObserver,
                        ActivityManager.UID_OBSERVER_CACHED | ActivityManager.UID_OBSERVER_GONE,
@@ -809,6 +819,7 @@ public class AudioService extends IAudioService.Stub
                // ignored; both services live in system_server
            }
        }
    }

    public void onSystemReady() {
        mSystemReady = true;