Let users change ringer volume in dialer.
.. and use STREAM_DTMF for stream type used with dialer.
For bug 6213100 : When volume is changed in phone dialer application,
the media volume is changed.
Bug: 6213100
Change-Id: I7ae8bde5f86c7ea70c8b075f2047b76a5ebb7c0a
diff --git a/src/com/android/contacts/dialpad/DialpadFragment.java b/src/com/android/contacts/dialpad/DialpadFragment.java
index 0de0f11..87e50a0 100644
--- a/src/com/android/contacts/dialpad/DialpadFragment.java
+++ b/src/com/android/contacts/dialpad/DialpadFragment.java
@@ -100,7 +100,7 @@
private static final int TONE_RELATIVE_VOLUME = 80;
/** Stream type used to play the DTMF tones off call, and mapped to the volume control keys */
- private static final int DIAL_TONE_STREAM_TYPE = AudioManager.STREAM_MUSIC;
+ private static final int DIAL_TONE_STREAM_TYPE = AudioManager.STREAM_DTMF;
/**
* View (usually FrameLayout) containing mDigits field. This can be null, in which mDigits
@@ -476,11 +476,7 @@
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
- // we want the user to be able to control the volume of the dial tones
- // outside of a call, so we use the stream type that is also mapped to the
- // volume control keys for this activity
mToneGenerator = new ToneGenerator(DIAL_TONE_STREAM_TYPE, TONE_RELATIVE_VOLUME);
- getActivity().setVolumeControlStream(DIAL_TONE_STREAM_TYPE);
} catch (RuntimeException e) {
Log.w(TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;