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

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

am 9ab05fff: Merge "Fix bug 2565463 Ensure an object cannot appear twice in...

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 '9ab05fff' into froyo-plus-aosp

* commit '9ab05fff':
  Fix bug 2565463 Ensure an object cannot appear twice in the
parents 6c8770df 9ab05fff
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);