Persist volume level on reconnections for Hearing Aid
Devices in mFullVolumeDevices have volume level reset to maximum value in checkFixedVolumeDevices. Bug: 69623109 Test: change Hearing Aid volume, restart phone, verify volume persisted Change-Id: Iba134c0b3dc959c19c59f89c3d4ac02eed1e216f
This commit is contained in:
@@ -588,7 +588,7 @@ public class AudioService extends IAudioService.Stub
|
||||
AudioSystem.DEVICE_OUT_HDMI_ARC |
|
||||
AudioSystem.DEVICE_OUT_SPDIF |
|
||||
AudioSystem.DEVICE_OUT_AUX_LINE;
|
||||
int mFullVolumeDevices = AudioSystem.DEVICE_OUT_HEARING_AID;
|
||||
int mFullVolumeDevices = 0;
|
||||
|
||||
private final boolean mMonitorRotation;
|
||||
|
||||
@@ -4765,6 +4765,8 @@ public class AudioService extends IAudioService.Stub
|
||||
index = getAbsoluteVolumeIndex((getIndex(device) + 5)/10);
|
||||
} else if ((device & mFullVolumeDevices) != 0) {
|
||||
index = (mIndexMax + 5)/10;
|
||||
} else if ((device & AudioSystem.DEVICE_OUT_HEARING_AID) != 0) {
|
||||
index = (mIndexMax + 5)/10;
|
||||
} else {
|
||||
index = (getIndex(device) + 5)/10;
|
||||
}
|
||||
@@ -4785,6 +4787,8 @@ public class AudioService extends IAudioService.Stub
|
||||
index = getAbsoluteVolumeIndex((getIndex(device) + 5)/10);
|
||||
} else if ((device & mFullVolumeDevices) != 0) {
|
||||
index = (mIndexMax + 5)/10;
|
||||
} else if ((device & AudioSystem.DEVICE_OUT_HEARING_AID) != 0) {
|
||||
index = (mIndexMax + 5)/10;
|
||||
} else {
|
||||
index = (mIndexMap.valueAt(i) + 5)/10;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user