【Android系统源码修改】系统音量的默认音量和最大音量的设置

找到 frameworks\base\media\java\android\media\AudioService.java 里的

   /** @hide Maximum volume index values for audio streams */
   /// M: Modify the max stream volume @{
    private static final int[] MAX_STREAM_VOLUME = new int[] {
        6,  // STREAM_VOICE_CALL
        12,  // STREAM_SYSTEM
        12,  // STREAM_RING
        15, // STREAM_MUSIC
        12,  // STREAM_ALARM
        12,  // STREAM_NOTIFICATION
        15, // STREAM_BLUETOOTH_SCO
        15,  // STREAM_SYSTEM_ENFORCED
        15, // STREAM_DTMF
        15,  // STREAM_TTS
    };
    /// @}
    /**
     * @hide Default volume index values for audio streams
     * M: modify the default stream volume @{
     */
    public static int[] DEFAULT_STREAM_VOLUME = new int[] {
        5,  // STREAM_VOICE_CALL
        11,  // STREAM_SYSTEM
        11,  // STREAM_RING
        11, // STREAM_MUSIC
        11,  // STREAM_ALARM
        11,  // STREAM_NOTIFICATION
        11,  // STREAM_BLUETOOTH_SCO
        11,  // STREAM_SYSTEM_ENFORCED
        11, // STREAM_DTMF
        11,  // STREAM_TTS
};

修改以上值就可以了。
或者
vendor\mediatek\proprietary\custom\common\cgen\cfgdefault\audio_ver1_volume_custom_default.h
里面的值也可以

你可能感兴趣的:(Android系统源码修改)