diff options
author | Joe Onorato <joeo@google.com> | 2011-01-05 16:53:11 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2011-01-05 16:53:11 -0800 |
commit | c7fcba4b7bd3d78e7cfe975a3f8e4dde2f6738b7 (patch) | |
tree | f0f54821896ab7214ace88bc9208de3f4ec615f3 /media | |
parent | 933464dd02e9aeaff7944a2c8e3e44942971e1e8 (diff) | |
download | frameworks_base-c7fcba4b7bd3d78e7cfe975a3f8e4dde2f6738b7.zip frameworks_base-c7fcba4b7bd3d78e7cfe975a3f8e4dde2f6738b7.tar.gz frameworks_base-c7fcba4b7bd3d78e7cfe975a3f8e4dde2f6738b7.tar.bz2 |
Make the volume keys adjust the media volume by default if the device is not "voice capable."
Change-Id: Ide396f8940a075c0b00b7c983c1769c1cc0f17bf
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioService.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 1d9ef65..97fcf27 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -85,7 +85,7 @@ public class AudioService extends IAudioService.Stub { private Context mContext; private ContentResolver mContentResolver; - + private boolean mVoiceCapable; /** The UI */ private VolumePanel mVolumePanel; @@ -283,6 +283,8 @@ public class AudioService extends IAudioService.Stub { public AudioService(Context context) { mContext = context; mContentResolver = context.getContentResolver(); + mVoiceCapable = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable); // Intialized volume MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = SystemProperties.getInt( @@ -1323,8 +1325,15 @@ public class AudioService extends IAudioService.Stub { // Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC..."); return AudioSystem.STREAM_MUSIC; } else if (suggestedStreamType == AudioManager.USE_DEFAULT_STREAM_TYPE) { - // Log.v(TAG, "getActiveStreamType: Forcing STREAM_RING..."); - return AudioSystem.STREAM_RING; + if (mVoiceCapable) { + // Log.v(TAG, "getActiveStreamType: Forcing STREAM_RING..." + // + " b/c USE_DEFAULT_STREAM_TYPE..."); + return AudioSystem.STREAM_RING; + } else { + // Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC " + // + " b/c USE_DEFAULT_STREAM_TYPE..."); + return AudioSystem.STREAM_MUSIC; + } } else { // Log.v(TAG, "getActiveStreamType: Returning suggested type " + suggestedStreamType); return suggestedStreamType; |