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

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

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

parents 2d59833e 41840fd7
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 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
@@ -2482,7 +2482,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);

@@ -2672,7 +2672,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