Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c274fb2d authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

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
parent 6a95a2cc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
                        }