summaryrefslogtreecommitdiffstats
path: root/services/java
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-11-30 10:05:52 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-30 10:05:52 -0800
commit55da000c1d2e0f50bf96953ea967d69b27d70ea3 (patch)
tree1cfd348a62f9a36a1900477c952968d546a4a7c6 /services/java
parenta615139dc33968e2ef69073cc925217879569db4 (diff)
parentbb3bb57a6330f71323fcd7e93e88dbdab55daec3 (diff)
downloadframeworks_base-55da000c1d2e0f50bf96953ea967d69b27d70ea3.zip
frameworks_base-55da000c1d2e0f50bf96953ea967d69b27d70ea3.tar.gz
frameworks_base-55da000c1d2e0f50bf96953ea967d69b27d70ea3.tar.bz2
am bb3bb57a: Merge change I524dc046 into eclair
Merge commit 'bb3bb57a6330f71323fcd7e93e88dbdab55daec3' into eclair-plus-aosp * commit 'bb3bb57a6330f71323fcd7e93e88dbdab55daec3': Fix issue 2192673: Music Pausing Even when notifications are set to silent.
Diffstat (limited to 'services/java')
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index ff23a13..94aa458 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -704,6 +704,9 @@ class NotificationManagerService extends INotificationManager.Stub
&& (!(old != null
&& (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
&& mSystemReady) {
+
+ final AudioManager audioManager = (AudioManager) mContext
+ .getSystemService(Context.AUDIO_SERVICE);
// sound
final boolean useDefaultSound =
(notification.defaults & Notification.DEFAULT_SOUND) != 0;
@@ -722,18 +725,20 @@ class NotificationManagerService extends INotificationManager.Stub
audioStreamType = DEFAULT_STREAM_TYPE;
}
mSoundNotification = r;
- long identity = Binder.clearCallingIdentity();
- try {
- mSound.play(mContext, uri, looping, audioStreamType);
- }
- finally {
- Binder.restoreCallingIdentity(identity);
+ // do not play notifications if stream volume is 0
+ // (typically because ringer mode is silent).
+ if (audioManager.getStreamVolume(audioStreamType) != 0) {
+ long identity = Binder.clearCallingIdentity();
+ try {
+ mSound.play(mContext, uri, looping, audioStreamType);
+ }
+ finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
}
// vibrate
- final AudioManager audioManager = (AudioManager) mContext
- .getSystemService(Context.AUDIO_SERVICE);
final boolean useDefaultVibrate =
(notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
if ((useDefaultVibrate || notification.vibrate != null)