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

Commit eb06bdd3 authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "Re: No mute state in volume context changes on abs devices" into main

parents 84b3f741 aad151ae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1472,8 +1472,8 @@ public class AudioDeviceBroker {
        mAudioService.postAccessoryPlugMediaUnmute(device);
    }

    /*package*/ int getVssVolumeForDevice(int streamType, int device) {
        return mAudioService.getVssVolumeForDevice(streamType, device);
    /*package*/ int getVolumeForDeviceIgnoreMute(int streamType, int device) {
        return mAudioService.getVolumeForDeviceIgnoreMute(streamType, device);
    }

    /*package*/ int getMaxVssVolumeForStream(int streamType) {
+2 −2
Original line number Diff line number Diff line
@@ -2482,7 +2482,7 @@ public class AudioDeviceInventory {
    @GuardedBy("mDevicesLock")
    private void makeHearingAidDeviceAvailable(
            String address, String name, int streamType, String eventSource) {
        final int hearingAidVolIndex = mDeviceBroker.getVssVolumeForDevice(streamType,
        final int hearingAidVolIndex = mDeviceBroker.getVolumeForDeviceIgnoreMute(streamType,
                DEVICE_OUT_HEARING_AID);
        mDeviceBroker.postSetHearingAidVolumeIndex(hearingAidVolIndex, streamType);

@@ -2672,7 +2672,7 @@ public class AudioDeviceInventory {
            }

            final int leAudioVolIndex = (volumeIndex == -1)
                    ? mDeviceBroker.getVssVolumeForDevice(streamType, device)
                    ? mDeviceBroker.getVolumeForDeviceIgnoreMute(streamType, device)
                    : volumeIndex;
            final int maxIndex = mDeviceBroker.getMaxVssVolumeForStream(streamType);
            mDeviceBroker.postSetLeAudioVolumeIndex(leAudioVolIndex, maxIndex, streamType);
+2 −2
Original line number Diff line number Diff line
@@ -529,7 +529,7 @@ public class AudioService extends IAudioService.Stub
     */
    private InputDeviceVolumeHelper mInputDeviceVolumeHelper;
    /*package*/ int getVssVolumeForDevice(int stream, int device) {
    /*package*/ int getVolumeForDeviceIgnoreMute(int stream, int device) {
        final VolumeStreamState streamState = mStreamStates.get(stream);
        return streamState != null ? streamState.getIndex(device) : -1;
    }
@@ -5100,7 +5100,7 @@ public class AudioService extends IAudioService.Stub
        }
        final int device = absVolumeDevices.toArray(new Integer[0])[0].intValue();
        final int index = getStreamVolume(streamType, device);
        final int index = (getVolumeForDeviceIgnoreMute(streamType, device) + 5) / 10;
        if (DEBUG_VOL) {
            Slog.i(TAG, "onUpdateContextualVolumes streamType: " + streamType
+1 −1
Original line number Diff line number Diff line
@@ -724,7 +724,7 @@ public class SoundDoseHelper {
                int device = mAudioService.getDeviceForStream(AudioSystem.STREAM_MUSIC);
                if (safeDevicesContains(device) && isStreamActive) {
                    scheduleMusicActiveCheck();
                    int index = mAudioService.getVssVolumeForDevice(AudioSystem.STREAM_MUSIC,
                    int index = mAudioService.getVolumeForDeviceIgnoreMute(AudioSystem.STREAM_MUSIC,
                            device);
                    if (index > safeMediaVolumeIndex(device)) {
                        // Approximate cumulative active music time