调整Android音量等级及默认音量

Android系统定制时,需要调整音量等级,以便实现更精确的音量,可通过如下方式修改。以通话音量等级为例

diff --git a/frameworks/base/services/core/java/com/android/server/audio/AudioService.java b/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
index 348c1ce..d0e63bb 100644
--- a/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
+++ b/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
@@ -325,7 +325,7 @@ public class AudioService extends IAudioService.Stub
 
    /** Maximum volume index values for audio streams */
     protected static int[] MAX_STREAM_VOLUME = new int[] {
-        5,  // STREAM_VOICE_CALL
+        9,  // STREAM_VOICE_CALL
         7,  // STREAM_SYSTEM
         7,  // STREAM_RING
         15, // STREAM_MUSIC

调整默认音量

diff --git a/frameworks/base/media/java/android/media/AudioSystem.java b/frameworks/base/media/java/android/media/AudioSystem.java
index b30c7b4..f2a3364 100644
--- a/frameworks/base/media/java/android/media/AudioSystem.java
+++ b/frameworks/base/media/java/android/media/AudioSystem.java
@@ -902,7 +902,7 @@ public class AudioSystem
     }
 
     public static int[] DEFAULT_STREAM_VOLUME = new int[] {
-        4,  // STREAM_VOICE_CALL
+        6,  // STREAM_VOICE_CALL
         7,  // STREAM_SYSTEM
         5,  // STREAM_RING
         5, // STREAM_MUSIC

 

你可能感兴趣的:(AUDIO)