diff options
author | Jonas Larsson <jonas@hallerud.se> | 2010-08-14 22:01:43 +0200 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-08-16 17:30:14 -0400 |
commit | 55443cc86fb4bb16ab735fa94132039cf481b9d3 (patch) | |
tree | 29d702225f9875b3db3e3afad0ea7baddaf92565 /services/java/com/android/server/NotificationPlayer.java | |
parent | 76ef08c2c94c7f9e27337cdd18aa0b43f68f6409 (diff) | |
download | frameworks_base-55443cc86fb4bb16ab735fa94132039cf481b9d3.zip frameworks_base-55443cc86fb4bb16ab735fa94132039cf481b9d3.tar.gz frameworks_base-55443cc86fb4bb16ab735fa94132039cf481b9d3.tar.bz2 |
Sound tweaks: Always on speaker 2.0, headphone attenuation, headphone music vol limit, audio focus requests.
Diffstat (limited to 'services/java/com/android/server/NotificationPlayer.java')
-rw-r--r-- | services/java/com/android/server/NotificationPlayer.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/java/com/android/server/NotificationPlayer.java b/services/java/com/android/server/NotificationPlayer.java index 52d2381..e36fc6f 100644 --- a/services/java/com/android/server/NotificationPlayer.java +++ b/services/java/com/android/server/NotificationPlayer.java @@ -26,6 +26,7 @@ import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.SystemClock; +import android.provider.Settings; import android.util.Log; import java.io.IOException; @@ -88,7 +89,9 @@ public class NotificationPlayer implements OnCompletionListener { player.setDataSource(mCmd.context, mCmd.uri); player.setLooping(mCmd.looping); player.prepare(); - if ((mCmd.uri != null) && (mCmd.uri.getEncodedPath() != null) + boolean requestFocus = Settings.System.getInt(mCmd.context.getContentResolver(), + Settings.System.NOTIFICATIONS_AUDIO_FOCUS, 1) != 0; + if (requestFocus && (mCmd.uri != null) && (mCmd.uri.getEncodedPath() != null) && (mCmd.uri.getEncodedPath().length() > 0)) { if (mCmd.looping) { audioManager.requestAudioFocus(null, mCmd.stream, |