summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2010-03-17 15:04:20 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2010-03-17 15:04:20 -0700
commit308e9a5d0975489982f93fd1f3728e6ed7a778d0 (patch)
treee64a128b64d195d8efa6ef33045eb51c1584f225 /media
parentd1f78767fc2be65ae4dc213b4f3a3e6abec0810d (diff)
downloadframeworks_base-308e9a5d0975489982f93fd1f3728e6ed7a778d0.zip
frameworks_base-308e9a5d0975489982f93fd1f3728e6ed7a778d0.tar.gz
frameworks_base-308e9a5d0975489982f93fd1f3728e6ed7a778d0.tar.bz2
Fix bug where the ID stored for an OnAudioFocusChangeListener is an
empty string when audio focus is requested or abandonned with a null listener. Change-Id: I7709b75c6092aefc002806343298bc679d42d6c6
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioManager.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 8462889..4d364ab 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -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;