android5.1 修改音量键绑定多媒体声音

修改此文件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; }

 重新编译后,按音量键提示栏为多媒体音量


 

android5.1 修改音量键绑定多媒体声音

上一篇:impdp报错:ORA-31693, ORA-02354, ORA-00600


下一篇:VS Code背景图片的设置和删除