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

Commit ac6fb79b authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by android-build-merger
Browse files

Merge "Audio service: always unduck focus requester when granted" into oc-dev am: 8e3a8a70

am: f306510b

Change-Id: I21a3b1a63aefbe27883454682db70baa77cc4292
parents ea5e8016 f306510b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -322,14 +322,23 @@ public class FocusRequester {
                if (mFocusLossWasNotified) {
                    fd.dispatchAudioFocusChange(focusGain, mClientId);
                }
                mFocusController.unduckPlayers(this);
            }
            mFocusController.unduckPlayers(this);
            mFocusLossWasNotified = false;
        } catch (android.os.RemoteException e) {
            Log.e(TAG, "Failure to signal gain of audio focus due to: ", e);
        }
    }

    /**
     * Called synchronized on MediaFocusControl.mAudioFocusLock
     */
    void handleFocusGainFromRequest(int focusRequestResult) {
        if (focusRequestResult == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
            mFocusController.unduckPlayers(this);
        }
    }

    /**
     * Called synchronized on MediaFocusControl.mAudioFocusLock
     */
+1 −0
Original line number Diff line number Diff line
@@ -752,6 +752,7 @@ public class MediaFocusControl implements PlayerFocusEnforcer {

                // push focus requester at the top of the audio focus stack
                mFocusStack.push(nfr);
                nfr.handleFocusGainFromRequest(AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
            }
            notifyExtPolicyFocusGrant_syncAf(nfr.toAudioFocusInfo(),
                    AudioManager.AUDIOFOCUS_REQUEST_GRANTED);