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

Commit a378de74 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "Fix bug where the ID stored for an OnAudioFocusChangeListener is an...

Merge "Fix bug where the ID stored for an OnAudioFocusChangeListener is an empty string when audio focus is requested or abandonned with a null listener."
parents aa773543 308e9a5d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1253,7 +1253,7 @@ public class AudioManager {

    private String getIdForAudioFocusListener(OnAudioFocusChangeListener l) {
        if (l == null) {
            return new String();
            return new String(this.toString());
        } else {
            return new String(this.toString() + l.toString());
        }
@@ -1263,9 +1263,6 @@ public class AudioManager {
     * Register a listener for audio focus updates.
     */
    public void registerAudioFocusListener(OnAudioFocusChangeListener l) {
        if (l == null) {
            return;
        }
        synchronized(mFocusListenerLock) {
            if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
                return;