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

Commit 35802a8e authored by Hongwei Wang's avatar Hongwei Wang Committed by android-build-merger
Browse files

Merge "Master mute is valid when running fixed volume for automotive" into pi-dev am: 69ed9985

am: c59f093c

Change-Id: I6297b819721537c211af1e9f198dd747480589f3
parents 836bfe5f c59f093c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -215,6 +215,10 @@ public class AudioService extends IAudioService.Stub
        return mPlatformType == AudioSystem.PLATFORM_TELEVISION;
    }

    private boolean isPlatformAutomotive() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
    }

    /** The controller for the volume UI. */
    private final VolumeController mVolumeController = new VolumeController();

@@ -2380,8 +2384,11 @@ public class AudioService extends IAudioService.Stub
        if (DEBUG_VOL) {
            Log.d(TAG, String.format("Master mute %s, %d, user=%d", mute, flags, userId));
        }
        if (mUseFixedVolume) {
            return; // If using fixed volume, we don't mute.
        if (!isPlatformAutomotive() && mUseFixedVolume) {
            // If using fixed volume, we don't mute.
            // TODO: remove the isPlatformAutomotive check here.
            // The isPlatformAutomotive check is added for safety but may not be necessary.
            return;
        }
        if (getCurrentUserId() == userId) {
            if (mute != AudioSystem.getMasterMute()) {