Loading services/core/java/com/android/server/audio/AudioService.java +53 −49 Original line number Diff line number Diff line Loading @@ -1028,6 +1028,7 @@ public class AudioService extends IAudioService.Stub } private void checkAllAliasStreamVolumes() { synchronized (mSettingsLock) { synchronized (VolumeStreamState.class) { int numStreamTypes = AudioSystem.getNumStreamTypes(); for (int streamType = 0; streamType < numStreamTypes; streamType++) { Loading @@ -1040,6 +1041,7 @@ public class AudioService extends IAudioService.Stub } } } } private void checkAllFixedVolumeDevices() { Loading Loading @@ -1141,13 +1143,16 @@ public class AudioService extends IAudioService.Stub if (updateVolumes && mStreamStates != null) { updateDefaultVolumes(); mStreamStates[AudioSystem.STREAM_DTMF].setAllIndexes(mStreamStates[dtmfStreamAlias], caller); synchronized (mSettingsLock) { 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].setAllIndexes( mStreamStates[a11yStreamAlias], caller); } } if (sIndependentA11yVolume) { // restore the a11y values from the settings mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].readSettings(); Loading Loading @@ -4590,12 +4595,12 @@ public class AudioService extends IAudioService.Stub * @param srcStream * @param caller */ // must be sync'd on mSettingsLock before VolumeStreamState.class @GuardedBy("VolumeStreamState.class") public void setAllIndexes(VolumeStreamState srcStream, String caller) { if (mStreamType == srcStream.mStreamType) { return; } synchronized (mSettingsLock) { synchronized (VolumeStreamState.class) { int srcStreamType = srcStream.getStreamType(); // apply default device volume from source stream to all devices first in case // some devices are present in this stream state but not in source stream state Loading @@ -4614,17 +4619,14 @@ public class AudioService extends IAudioService.Stub setIndex(index, device, caller); } } } } @GuardedBy("mSettingsLock") // must be sync'd on mSettingsLock before VolumeStreamState.class @GuardedBy("VolumeStreamState.class") public void setAllIndexesToMax() { synchronized (VolumeStreamState.class) { for (int i = 0; i < mIndexMap.size(); i++) { mIndexMap.put(mIndexMap.keyAt(i), mIndexMax); } } } public void mute(boolean state) { boolean changed = false; Loading Loading @@ -6201,6 +6203,7 @@ public class AudioService extends IAudioService.Stub mCameraSoundForced = cameraSoundForced; if (cameraSoundForcedChanged) { if (!mIsSingleVolume) { synchronized (VolumeStreamState.class) { VolumeStreamState s = mStreamStates[AudioSystem.STREAM_SYSTEM_ENFORCED]; if (cameraSoundForced) { s.setAllIndexesToMax(); Loading @@ -6211,6 +6214,7 @@ public class AudioService extends IAudioService.Stub mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_SYSTEM_ENFORCED); } } // take new state into account for streams muted by ringer mode setRingerModeInt(getRingerModeInternal(), false); } Loading Loading
services/core/java/com/android/server/audio/AudioService.java +53 −49 Original line number Diff line number Diff line Loading @@ -1028,6 +1028,7 @@ public class AudioService extends IAudioService.Stub } private void checkAllAliasStreamVolumes() { synchronized (mSettingsLock) { synchronized (VolumeStreamState.class) { int numStreamTypes = AudioSystem.getNumStreamTypes(); for (int streamType = 0; streamType < numStreamTypes; streamType++) { Loading @@ -1040,6 +1041,7 @@ public class AudioService extends IAudioService.Stub } } } } private void checkAllFixedVolumeDevices() { Loading Loading @@ -1141,13 +1143,16 @@ public class AudioService extends IAudioService.Stub if (updateVolumes && mStreamStates != null) { updateDefaultVolumes(); mStreamStates[AudioSystem.STREAM_DTMF].setAllIndexes(mStreamStates[dtmfStreamAlias], caller); synchronized (mSettingsLock) { 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].setAllIndexes( mStreamStates[a11yStreamAlias], caller); } } if (sIndependentA11yVolume) { // restore the a11y values from the settings mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].readSettings(); Loading Loading @@ -4590,12 +4595,12 @@ public class AudioService extends IAudioService.Stub * @param srcStream * @param caller */ // must be sync'd on mSettingsLock before VolumeStreamState.class @GuardedBy("VolumeStreamState.class") public void setAllIndexes(VolumeStreamState srcStream, String caller) { if (mStreamType == srcStream.mStreamType) { return; } synchronized (mSettingsLock) { synchronized (VolumeStreamState.class) { int srcStreamType = srcStream.getStreamType(); // apply default device volume from source stream to all devices first in case // some devices are present in this stream state but not in source stream state Loading @@ -4614,17 +4619,14 @@ public class AudioService extends IAudioService.Stub setIndex(index, device, caller); } } } } @GuardedBy("mSettingsLock") // must be sync'd on mSettingsLock before VolumeStreamState.class @GuardedBy("VolumeStreamState.class") public void setAllIndexesToMax() { synchronized (VolumeStreamState.class) { for (int i = 0; i < mIndexMap.size(); i++) { mIndexMap.put(mIndexMap.keyAt(i), mIndexMax); } } } public void mute(boolean state) { boolean changed = false; Loading Loading @@ -6201,6 +6203,7 @@ public class AudioService extends IAudioService.Stub mCameraSoundForced = cameraSoundForced; if (cameraSoundForcedChanged) { if (!mIsSingleVolume) { synchronized (VolumeStreamState.class) { VolumeStreamState s = mStreamStates[AudioSystem.STREAM_SYSTEM_ENFORCED]; if (cameraSoundForced) { s.setAllIndexesToMax(); Loading @@ -6211,6 +6214,7 @@ public class AudioService extends IAudioService.Stub mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_SYSTEM_ENFORCED); } } // take new state into account for streams muted by ringer mode setRingerModeInt(getRingerModeInternal(), false); } Loading