Android6.0源码开发之修改默认音量default及max和min

1,修改默认音量的位置为android/frameworks/base/media/java/android/media/AudioSystem.java

  public static int[] DEFAULT_STREAM_VOLUME = new int[] {
        4,  // STREAM_VOICE_CALL  普通通话音量
        7,  // STREAM_SYSTEM
        5,  // STREAM_RING      铃声
        11, // STREAM_MUSIC     音乐
        6,  // STREAM_ALARM     闹钟
        5,  // STREAM_NOTIFICATION 通知
        7,  // STREAM_BLUETOOTH_SCO 蓝牙耳机通话音量
        7,  // STREAM_SYSTEM_ENFORCED 
        11, // STREAM_DTMF
        11  // STREAM_TTS
    };

2,修改默认音量的最大值/最小值:android/frameworks/base/services/core/java/com/android/server/audio/AudioService.java


/** Maximum volume index values for audio streams */
    private static int[] MAX_STREAM_VOLUME = new int[] {
        5,  // STREAM_VOICE_CALL
        7,  // STREAM_SYSTEM
        7,  // STREAM_RING
        15, // STREAM_MUSIC
        7,  // STREAM_ALARM
        7,  // STREAM_NOTIFICATION
        15, // STREAM_BLUETOOTH_SCO
        7,  // STREAM_SYSTEM_ENFORCED
        15, // STREAM_DTMF
        15  // STREAM_TTS
    };

    /** Minimum volume index values for audio streams */
    private static int[] MIN_STREAM_VOLUME = new int[] {
        1,  // STREAM_VOICE_CALL
        0,  // STREAM_SYSTEM
        0,  // STREAM_RING
        0,  // STREAM_MUSIC
        0,  // STREAM_ALARM
        0,  // STREAM_NOTIFICATION
        1,  // STREAM_BLUETOOTH_SCO
        0,  // STREAM_SYSTEM_ENFORCED
        0,  // STREAM_DTMF
        0   // STREAM_TTS
    };

3,修改默认通知铃声 android/build/target/product/full_base.mk或者是android/build/target/product/core_base.mk

  ro.config.ringtone=BeatPlucker.ogg \  #手机铃声
  ro.config.notification_sound=Pollux.ogg  #提示音和通知
  ro.config.alarm_alert=Alarm_Classic.ogg  #闹钟铃声






你可能感兴趣的:(源码,默认,音量,Android6.0,通知铃声)