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

Commit 055897ac authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android Git Automerger
Browse files

am 28525488: am 9ab05fff: Merge "Fix bug 2565463 Ensure an object cannot...

am 28525488: am 9ab05fff: Merge "Fix bug 2565463 Ensure an object cannot appear twice in the  AudioFocus stack.  Enforce parameter check in AudioManager.requestAudioFocus()  Typo correction in AudioService.unregisterMediaButtonEventReceiver()" into froyo

Merge commit '28525488' into kraken

* commit '28525488':
  Fix bug 2565463 Ensure an object cannot appear twice in the
parents 4cd79e3c 28525488
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1437,6 +1437,11 @@ public class AudioManager {
     */
    public int requestAudioFocus(OnAudioFocusChangeListener l, int streamType, int durationHint) {
        int status = AUDIOFOCUS_REQUEST_FAILED;
        if ((durationHint < AUDIOFOCUS_GAIN) || (durationHint > AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK))
        {
            Log.e(TAG, "Invalid duration hint, audio focus request denied");
            return status;
        }
        registerAudioFocusListener(l);
        //TODO protect request by permission check?
        IAudioService service = getService();
+4 −1
Original line number Diff line number Diff line
@@ -2063,6 +2063,9 @@ public class AudioService extends IAudioService.Stub {
                }
            }

            // focus requester might already be somewhere below in the stack, remove it
            removeFocusStackEntry(clientId, false);

            // push focus requester at the top of the audio focus stack
            mFocusStack.push(new FocusStackEntry(mainStreamType, focusChangeHint, false, fd, cb,
                    clientId));
@@ -2215,7 +2218,7 @@ public class AudioService extends IAudioService.Stub {

    /** see AudioManager.unregisterMediaButtonEventReceiver(ComponentName eventReceiver) */
    public void unregisterMediaButtonEventReceiver(ComponentName eventReceiver) {
        Log.i(TAG, "  Remote Control   registerMediaButtonEventReceiver() for " + eventReceiver);
        Log.i(TAG, "  Remote Control   unregisterMediaButtonEventReceiver() for " + eventReceiver);

        synchronized(mRCStack) {
            removeMediaButtonReceiver(eventReceiver);