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

Commit f15c7ae7 authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge changes from topic "presubmit-am-dbbf3fe15cfd41418536f2a1dc34cd14" into...

Merge changes from topic "presubmit-am-dbbf3fe15cfd41418536f2a1dc34cd14" into tm-qpr-dev-plus-aosp am: 1901131a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22648361



Change-Id: I70f383aee59d11724a24cf16d6288050d12da242
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d7e96cf6 1901131a
Loading
Loading
Loading
Loading
+32 −6
Original line number Diff line number Diff line
@@ -2284,8 +2284,8 @@ public class AudioService extends IAudioService.Stub
                synchronized (VolumeStreamState.class) {
                    mStreamStates[AudioSystem.STREAM_DTMF]
                            .setAllIndexes(mStreamStates[dtmfStreamAlias], caller);
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].mVolumeIndexSettingName =
                            System.VOLUME_SETTINGS_INT[a11yStreamAlias];
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].setSettingName(
                            System.VOLUME_SETTINGS_INT[a11yStreamAlias]);
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].setAllIndexes(
                            mStreamStates[a11yStreamAlias], caller);
                }
@@ -7700,7 +7700,7 @@ public class AudioService extends IAudioService.Stub
        private int mPublicStreamType = AudioSystem.STREAM_MUSIC;
        private AudioAttributes mAudioAttributes = AudioProductStrategy.getDefaultAttributes();
        private boolean mIsMuted = false;
        private final String mSettingName;
        private String mSettingName;
        // No API in AudioSystem to get a device from strategy or from attributes.
        // Need a valid public stream type to use current API getDeviceForStream
@@ -8029,15 +8029,19 @@ public class AudioService extends IAudioService.Stub
        }
        private void persistVolumeGroup(int device) {
            if (mUseFixedVolume) {
            // No need to persist the index if the volume group is backed up
            // by a public stream type as this is redundant
            if (mUseFixedVolume || mHasValidStreamType) {
                return;
            }
            if (DEBUG_VOL) {
                Log.v(TAG, "persistVolumeGroup: storing index " + getIndex(device) + " for group "
                        + mAudioVolumeGroup.name()
                        + ", device " + AudioSystem.getOutputDeviceName(device)
                        + " and User=" + getCurrentUserId());
                        + " and User=" + getCurrentUserId()
                        + " mSettingName: " + mSettingName);
            }
            boolean success = mSettings.putSystemIntForUser(mContentResolver,
                    getSettingNameForDevice(device),
                    getIndex(device),
@@ -8100,6 +8104,14 @@ public class AudioService extends IAudioService.Stub
            return mSettingName + "_" + AudioSystem.getOutputDeviceName(device);
        }
        void setSettingName(String settingName) {
            mSettingName = settingName;
        }
        String getSettingName() {
            return mSettingName;
        }
        private void dump(PrintWriter pw) {
            pw.println("- VOLUME GROUP " + mAudioVolumeGroup.name() + ":");
            pw.print("   Muted: ");
@@ -8242,6 +8254,9 @@ public class AudioService extends IAudioService.Stub
         */
        public void setVolumeGroupState(VolumeGroupState volumeGroupState) {
            mVolumeGroupState = volumeGroupState;
            if (mVolumeGroupState != null) {
                mVolumeGroupState.setSettingName(mVolumeIndexSettingName);
            }
        }
        /**
         * Update the minimum index that can be used without MODIFY_AUDIO_SETTINGS permission
@@ -8315,6 +8330,17 @@ public class AudioService extends IAudioService.Stub
            return (mVolumeIndexSettingName != null && !mVolumeIndexSettingName.isEmpty());
        }
        void setSettingName(String settingName) {
            mVolumeIndexSettingName = settingName;
            if (mVolumeGroupState != null) {
                mVolumeGroupState.setSettingName(mVolumeIndexSettingName);
            }
        }
        String getSettingName() {
            return mVolumeIndexSettingName;
        }
        public void readSettings() {
            synchronized (mSettingsLock) {
                synchronized (VolumeStreamState.class) {