Changing the system default volume requires two places:
1. Frameworks\base\media\java\android\media\audiomanager.java
1 /**@hide Default Volume index values for audio streams*/2 Public Static Final int[] Default_stream_volume =New int[] {34,//Stream_voice_call47,//Stream_system55,//stream_ring68,//One ,//Stream_music76,//Stream_alarm85,//stream_notification97,//Stream_bluetooth_scoTen7,//stream_system_enforced One11,//STREAM_DTMF A11,//Stream_tts -4//Stream_incall_music -};
The volume value here is used to generate the value of the Settings.db database field. The path to the Settings.db database in Android 5.x is under the/data/data/com.android.providers.settings/database/directory.
2. Frameworks\base\media\java\android\media\audioservice.java
1 /**@hide Maximum Volume index values for audio streams*/2 Private Static int[] Max_stream_volume =New int[] {315,//Stream_voice_call47,//Stream_system57,//stream_ring615,//Stream_music77,//Stream_alarm87,//stream_notification915,//Stream_bluetooth_scoTen7,//stream_system_enforced One15,//STREAM_DTMF A15//Stream_tts - }; - the Private Static int[] Default_stream_volume =New int[] { -15,//Stream_voice_call -7,//Stream_system -5,//stream_ring +8,//One ,//Stream_music -6,//Stream_alarm +5,//stream_notification A7,//Stream_bluetooth_sco at7,//stream_system_enforced -11,//STREAM_DTMF -11//Stream_tts -};
The Max_stream_volume array is the system maximum volume value.
The Default_stream_volume array is the system default volume value.
Modify the Android 5.x system default volume size