MTK Android5.1调节媒体以及系统默认音量的大小

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lwz622/article/details/82790879

*******************************************************************
* 由于在某些特定的场合,所持设备的默认音量会因为外界的干扰,而变得非常弱小,
* 于是就有客户提出默认音量最大。 
******************************************************************

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
        15,  // STREAM_SYSTEM
        15,  // STREAM_RING
        15, // STREAM_MUSIC
        15,  // STREAM_ALARM
        15,  // 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[] {
        4,  // STREAM_VOICE_CALL
        15,  // STREAM_SYSTEM
        8,  // STREAM_RING
        15, // STREAM_MUSIC
        8,  // STREAM_ALARM
        8,  // STREAM_NOTIFICATION
        7,  // STREAM_BLUETOOTH_SCO
        15,  // STREAM_SYSTEM_ENFORCED
        11, // STREAM_DTMF
        11,  // STREAM_TTS
    };
    /** @ */

对于MTK来说,音量的最大值为15。上面代码简单明了的说明了,媒体以及各种音量的调节。

你可能感兴趣的:(android,framework)