summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2010-05-12 07:48:50 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-12 07:48:50 -0700
commitea37d9b489aac1a4a8de71887581fe712e26e144 (patch)
tree47fc075ce479bb3f7eccec1cdb077772d763f58f /services
parentd8c33747afbe98e893e0569f3bf45b67a9e8e728 (diff)
parentaaa01b181c0eea4ff6496d446e25e499b12ca14c (diff)
downloadframeworks_base-ea37d9b489aac1a4a8de71887581fe712e26e144.zip
frameworks_base-ea37d9b489aac1a4a8de71887581fe712e26e144.tar.gz
frameworks_base-ea37d9b489aac1a4a8de71887581fe712e26e144.tar.bz2
am aaa01b18: Merge " Fix bug 2670395 and 2599698 When the user selects a "Silent" notification sound, the Uri encoded path is an empty string. Setting this Uri as the data source of the MediaPlayer used to play notifications caused the completion listen
Merge commit 'aaa01b181c0eea4ff6496d446e25e499b12ca14c' into froyo-plus-aosp * commit 'aaa01b181c0eea4ff6496d446e25e499b12ca14c': Fix bug 2670395 and 2599698
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NotificationPlayer.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/services/java/com/android/server/NotificationPlayer.java b/services/java/com/android/server/NotificationPlayer.java
index 0b1a03b..52d2381 100644
--- a/services/java/com/android/server/NotificationPlayer.java
+++ b/services/java/com/android/server/NotificationPlayer.java
@@ -88,12 +88,15 @@ public class NotificationPlayer implements OnCompletionListener {
player.setDataSource(mCmd.context, mCmd.uri);
player.setLooping(mCmd.looping);
player.prepare();
- if (mCmd.looping) {
- audioManager.requestAudioFocus(null, mCmd.stream,
- AudioManager.AUDIOFOCUS_GAIN);
- } else {
- audioManager.requestAudioFocus(null, mCmd.stream,
- AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);
+ if ((mCmd.uri != null) && (mCmd.uri.getEncodedPath() != null)
+ && (mCmd.uri.getEncodedPath().length() > 0)) {
+ if (mCmd.looping) {
+ audioManager.requestAudioFocus(null, mCmd.stream,
+ AudioManager.AUDIOFOCUS_GAIN);
+ } else {
+ audioManager.requestAudioFocus(null, mCmd.stream,
+ AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);
+ }
}
player.setOnCompletionListener(NotificationPlayer.this);
player.start();