Loading core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -3122,6 +3122,13 @@ public final class Settings { "navigation_ring_targets_2", }; /** * Volume key controls ringtone or media sound stream * * @hide */ public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading media/java/android/media/AudioService.java +19 −3 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished { private int mDockState = Intent.EXTRA_DOCK_STATE_UNDOCKED; private boolean mVolumeKeysControlRingStream; /////////////////////////////////////////////////////////////////////////// // Construction /////////////////////////////////////////////////////////////////////////// Loading Loading @@ -768,6 +770,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { readDockAudioSettings(cr); mSafeVolumeEnabled = new Boolean(safeVolumeEnabled(cr)); mVolumeKeysControlRingStream = Settings.System.getIntForUser(cr, Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM, 1, UserHandle.USER_CURRENT) == 1; } mLinkNotificationWithVolume = Settings.System.getIntForUser(cr, Loading Loading @@ -2538,9 +2543,15 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC stream active"); return AudioSystem.STREAM_MUSIC; } else { if (mVolumeKeysControlRingStream) { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_RING b/c default"); return AudioSystem.STREAM_RING; } else { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC b/c default setting"); return AudioSystem.STREAM_MUSIC; } } } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC, 0)) { if (DEBUG_VOL) Loading Loading @@ -3544,6 +3555,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Settings.System.VOLUME_LINK_NOTIFICATION), false, this); mContentResolver.registerContentObserver(Settings.System.getUriFor( Settings.System.SAFE_HEADSET_VOLUME), false, this); mContentResolver.registerContentObserver(Settings.System.getUriFor( Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM), false, this); } @Override Loading Loading @@ -3595,6 +3608,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { } else if (uri.equals(Settings.System.getUriFor(Settings.System.SAFE_HEADSET_VOLUME))) { mSafeVolumeEnabled = safeVolumeEnabled(mContentResolver); } else if (uri.equals(Settings.System.getUriFor(Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM))) { mVolumeKeysControlRingStream = Settings.System.getIntForUser(mContentResolver, Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM, 1, UserHandle.USER_CURRENT) == 1; } } } Loading Loading
core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -3122,6 +3122,13 @@ public final class Settings { "navigation_ring_targets_2", }; /** * Volume key controls ringtone or media sound stream * * @hide */ public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading
media/java/android/media/AudioService.java +19 −3 Original line number Diff line number Diff line Loading @@ -448,6 +448,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished { private int mDockState = Intent.EXTRA_DOCK_STATE_UNDOCKED; private boolean mVolumeKeysControlRingStream; /////////////////////////////////////////////////////////////////////////// // Construction /////////////////////////////////////////////////////////////////////////// Loading Loading @@ -768,6 +770,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { readDockAudioSettings(cr); mSafeVolumeEnabled = new Boolean(safeVolumeEnabled(cr)); mVolumeKeysControlRingStream = Settings.System.getIntForUser(cr, Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM, 1, UserHandle.USER_CURRENT) == 1; } mLinkNotificationWithVolume = Settings.System.getIntForUser(cr, Loading Loading @@ -2538,9 +2543,15 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC stream active"); return AudioSystem.STREAM_MUSIC; } else { if (mVolumeKeysControlRingStream) { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_RING b/c default"); return AudioSystem.STREAM_RING; } else { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC b/c default setting"); return AudioSystem.STREAM_MUSIC; } } } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC, 0)) { if (DEBUG_VOL) Loading Loading @@ -3544,6 +3555,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished { Settings.System.VOLUME_LINK_NOTIFICATION), false, this); mContentResolver.registerContentObserver(Settings.System.getUriFor( Settings.System.SAFE_HEADSET_VOLUME), false, this); mContentResolver.registerContentObserver(Settings.System.getUriFor( Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM), false, this); } @Override Loading Loading @@ -3595,6 +3608,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { } else if (uri.equals(Settings.System.getUriFor(Settings.System.SAFE_HEADSET_VOLUME))) { mSafeVolumeEnabled = safeVolumeEnabled(mContentResolver); } else if (uri.equals(Settings.System.getUriFor(Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM))) { mVolumeKeysControlRingStream = Settings.System.getIntForUser(mContentResolver, Settings.System.VOLUME_KEYS_CONTROL_RING_STREAM, 1, UserHandle.USER_CURRENT) == 1; } } } Loading