Modify the Android 5.x system default volume size

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.