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

Commit 41840fd7 authored by Neha Jain's avatar Neha Jain Committed by Android (Google) Code Review
Browse files

Revert "No mute state in volume context changes on abs devices"

This reverts commit 680eba68.

Reason for revert: b/401136954

Change-Id: If358578936a6b67f8fe4a444b45f83ec979a0d17
parent 680eba68
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1484,8 +1484,8 @@ public class AudioDeviceBroker {
        mAudioService.postAccessoryPlugMediaUnmute(device);
    }

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

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

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

            final int leAudioVolIndex = (volumeIndex == -1)
                    ? mDeviceBroker.getVolumeForDeviceIgnoreMute(streamType, device)
                    ? mDeviceBroker.getVssVolumeForDevice(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 getVolumeForDeviceIgnoreMute(int stream, int device) {
    /*package*/ int getVssVolumeForDevice(int stream, int device) {
        final VolumeStreamState streamState = mStreamStates.get(stream);
        return streamState != null ? streamState.getIndex(device) : -1;
    }
@@ -5098,7 +5098,7 @@ public class AudioService extends IAudioService.Stub
        }
        final int device = absVolumeDevices.toArray(new Integer[0])[0].intValue();
        final int index = getVolumeForDeviceIgnoreMute(streamType, device);
        final int index = getStreamVolume(streamType, device);
        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.getVolumeForDeviceIgnoreMute(AudioSystem.STREAM_MUSIC,
                    int index = mAudioService.getVssVolumeForDevice(AudioSystem.STREAM_MUSIC,
                            device);
                    if (index > safeMediaVolumeIndex(device)) {
                        // Approximate cumulative active music time