修改此文件frameworks/base/media/java/android/media/AudioService.java中函数
private int getActiveStreamType(int suggestedStreamType) { ............... ............... else if (suggestedStreamType == AudioManager.USE_DEFAULT_STREAM_TYPE) { /* carroll 修改音量键默认调节多媒体音量 start */ /* if (isAfMusicActiveRecently(StreamOverride.sDelayMs)) { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: forcing STREAM_MUSIC");*/ return AudioSystem.STREAM_MUSIC; /* } else { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: using STREAM_NOTIFICATION as default"); return AudioSystem.STREAM_NOTIFICATION; }*/ /* carroll 修改音量键默认调节多媒体音量 end */ } break; } if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Returning suggested type " + suggestedStreamType); return suggestedStreamType; }
重新编译后,按音量键提示栏为多媒体音量
原文地址:https://www.cnblogs.com/CZM-/p/9551331.html
时间: 2024-10-31 11:34:01