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

Commit 295fd0fc authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Persist volume level on reconnections for Hearing Aid

am: c274fb2d

Change-Id: Ie41328cc89e3deb81dbafd453093cfe6be18c5cd
parents 3cb59428 c274fb2d
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;

@@ -4774,6 +4774,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;
            }
@@ -4794,6 +4796,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;
                        }