您的位置:首页 > 其它

音量加减键修改为默认控制媒体音量

2012-06-02 11:39 330 查看
默认是控制Ringer volume。

frameworks/base/core/res/res/values/strings.xml: <string name="volume_ringtone">Ringer volume</string>

<!-- Title of the dialog where the user is adjusting the phone ringer volume -->
<string name="volume_ringtone">Ringer volume</string>
<!-- Title of the dialog where the user is adjusting the music volume -->
<string name="volume_music">Media volume</string>

frameworks/base/core/java/android/view/VolumePanel.java: private static final int RINGTONE_VOLUME_TEXT = com.android.internal.R.string.volume_ringtone;
case AudioManager.STREAM_RING:
case AudioManager.STREAM_MUSIC:
case MSG_VOLUME_CHANGED: {
onVolumeChanged(msg.arg1, msg.arg2);
break;
}
public void postVolumeChanged(int streamType, int flags)
frameworks/base/media/java/android/media/AudioService.java: mVolumePanel.postVolumeChanged(streamType, flags);
public void setStreamVolume(int streamType, int index, int flags)
public void adjustStreamVolume(int streamType, int direction, int flags)
public void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags)
public void adjustVolume(int direction, int flags)
AudioManager.USE_DEFAULT_STREAM_TYPE
private int getActiveStreamType(int suggestedStreamType)
} else if (suggestedStreamType == AudioManager.USE_DEFAULT_STREAM_TYPE) {
// Log.v(TAG, "getActiveStreamType: Forcing STREAM_RING...");
//jeff. return AudioSystem.STREAM_RING;
return AudioSystem.STREAM_MUSIC;
} else {

修改后就是默认媒体音量了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  stream dialog string user