OSDN Git Service

AudioService: Fix absolute volume for AVRCP
[android-x86/frameworks-base.git] / media / java / android / media / AudioService.java
index 92474df..65037c5 100644 (file)
@@ -1018,8 +1018,6 @@ public class AudioService extends IAudioService.Stub {
 
             oldIndex = streamState.getIndex(device);
 
-            index = rescaleIndex(index * 10, streamType, streamTypeAlias);
-
             if (streamTypeAlias == AudioSystem.STREAM_MUSIC &&
                 (device & AudioSystem.DEVICE_OUT_ALL_A2DP) != 0 &&
                 (flags & AudioManager.FLAG_BLUETOOTH_ABS_VOLUME) == 0) {
@@ -1030,6 +1028,8 @@ public class AudioService extends IAudioService.Stub {
                 }
             }
 
+            index = rescaleIndex(index * 10, streamType, streamTypeAlias);
+
             flags &= ~AudioManager.FLAG_FIXED_VOLUME;
             if ((streamTypeAlias == AudioSystem.STREAM_MUSIC) &&
                     ((device & mFixedVolumeDevices) != 0)) {