Loading core/java/android/view/VolumePanel.java +20 −1 Original line number Diff line number Diff line Loading @@ -103,6 +103,9 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie private boolean mShowCombinedVolumes; private boolean mVoiceCapable; // True if we want to play tones on the system stream when the master stream is specified. private final boolean mPlayMasterStreamTones; /** Dialog containing all the sliders */ private final Dialog mDialog; /** Dialog's content view */ Loading Loading @@ -275,6 +278,13 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie mMoreButton.setOnClickListener(this); } boolean masterVolumeOnly = context.getResources().getBoolean( com.android.internal.R.bool.config_useMasterVolume); boolean masterVolumeKeySounds = mContext.getResources().getBoolean( com.android.internal.R.bool.config_useVolumeKeySounds); mPlayMasterStreamTones = masterVolumeOnly && masterVolumeKeySounds; listenToRingerMode(); } Loading Loading @@ -657,7 +667,16 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie * Lock on this VolumePanel instance as long as you use the returned ToneGenerator. */ private ToneGenerator getOrCreateToneGenerator(int streamType) { if (streamType == STREAM_MASTER) return null; if (streamType == STREAM_MASTER) { // For devices that use the master volume setting only but still want to // play a volume-changed tone, direct the master volume pseudostream to // the system stream's tone generator. if (mPlayMasterStreamTones) { streamType = AudioManager.STREAM_SYSTEM; } else { return null; } } synchronized (this) { if (mToneGenerators[streamType] == null) { try { Loading media/java/android/media/AudioManager.java +1 −5 Original line number Diff line number Diff line Loading @@ -460,8 +460,6 @@ public class AudioManager { * responsive to the user. */ int flags = FLAG_SHOW_UI | FLAG_VIBRATE; // if there is no volume key-up sound, apply the new volume immediately if (!mUseVolumeKeySounds) flags |= FLAG_PLAY_SOUND; if (mUseMasterVolume) { adjustMasterVolume( Loading Loading @@ -508,9 +506,7 @@ public class AudioManager { */ if (mUseVolumeKeySounds) { if (mUseMasterVolume) { if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { adjustMasterVolume(ADJUST_SAME, FLAG_PLAY_SOUND); } } else { int flags = FLAG_PLAY_SOUND; if (mVolumeControlStream != -1) { Loading Loading
core/java/android/view/VolumePanel.java +20 −1 Original line number Diff line number Diff line Loading @@ -103,6 +103,9 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie private boolean mShowCombinedVolumes; private boolean mVoiceCapable; // True if we want to play tones on the system stream when the master stream is specified. private final boolean mPlayMasterStreamTones; /** Dialog containing all the sliders */ private final Dialog mDialog; /** Dialog's content view */ Loading Loading @@ -275,6 +278,13 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie mMoreButton.setOnClickListener(this); } boolean masterVolumeOnly = context.getResources().getBoolean( com.android.internal.R.bool.config_useMasterVolume); boolean masterVolumeKeySounds = mContext.getResources().getBoolean( com.android.internal.R.bool.config_useVolumeKeySounds); mPlayMasterStreamTones = masterVolumeOnly && masterVolumeKeySounds; listenToRingerMode(); } Loading Loading @@ -657,7 +667,16 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie * Lock on this VolumePanel instance as long as you use the returned ToneGenerator. */ private ToneGenerator getOrCreateToneGenerator(int streamType) { if (streamType == STREAM_MASTER) return null; if (streamType == STREAM_MASTER) { // For devices that use the master volume setting only but still want to // play a volume-changed tone, direct the master volume pseudostream to // the system stream's tone generator. if (mPlayMasterStreamTones) { streamType = AudioManager.STREAM_SYSTEM; } else { return null; } } synchronized (this) { if (mToneGenerators[streamType] == null) { try { Loading
media/java/android/media/AudioManager.java +1 −5 Original line number Diff line number Diff line Loading @@ -460,8 +460,6 @@ public class AudioManager { * responsive to the user. */ int flags = FLAG_SHOW_UI | FLAG_VIBRATE; // if there is no volume key-up sound, apply the new volume immediately if (!mUseVolumeKeySounds) flags |= FLAG_PLAY_SOUND; if (mUseMasterVolume) { adjustMasterVolume( Loading Loading @@ -508,9 +506,7 @@ public class AudioManager { */ if (mUseVolumeKeySounds) { if (mUseMasterVolume) { if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { adjustMasterVolume(ADJUST_SAME, FLAG_PLAY_SOUND); } } else { int flags = FLAG_PLAY_SOUND; if (mVolumeControlStream != -1) { Loading