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

Commit 1d83a5bf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Switch to use audio usage instead of stream_type in Car Settings UI"

parents a2d0fc00 d8ce3006
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import com.android.internal.annotations.GuardedBy;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.SysUiServiceProvider;
import com.android.systemui.keyguard.ScreenLifecycle;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.plugins.VolumeDialogController;
import com.android.systemui.qs.tiles.DndTile;
+6 −4
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import com.android.systemui.volume.VolumeDialogControllerImpl;

/**
 * A volume dialog controller for the automotive use case.
 * TODO(hwwang): consider removing this class since it's coupled with stream_type and we are
 * moving to use AudioAttributes usage for volume control in a car.
 *
 * {@link android.car.media.CarAudioManager} is the source of truth to get the stream volumes.
 * And volume changes should be sent to the car's audio module instead of the android's audio mixer.
@@ -70,7 +72,7 @@ public class CarVolumeDialogController extends VolumeDialogControllerImpl {
            return;
        }
        try {
            mCarAudioManager.setStreamVolume(stream, level, flag);
            mCarAudioManager.setUsageVolume(stream, level, flag);
        } catch (CarNotConnectedException e) {
            Log.e(TAG, "Car is not connected", e);
        }
@@ -84,7 +86,7 @@ public class CarVolumeDialogController extends VolumeDialogControllerImpl {
        }

        try {
            return mCarAudioManager.getStreamVolume(stream);
            return mCarAudioManager.getUsageVolume(stream);
        } catch (CarNotConnectedException e) {
            Log.e(TAG, "Car is not connected", e);
            return 0;
@@ -99,7 +101,7 @@ public class CarVolumeDialogController extends VolumeDialogControllerImpl {
        }

        try {
            return mCarAudioManager.getStreamMaxVolume(stream);
            return mCarAudioManager.getUsageMaxVolume(stream);
        } catch (CarNotConnectedException e) {
            Log.e(TAG, "Car is not connected", e);
            return 0;
@@ -114,7 +116,7 @@ public class CarVolumeDialogController extends VolumeDialogControllerImpl {
        }

        try {
            return mCarAudioManager.getStreamMinVolume(stream);
            return mCarAudioManager.getUsageMinVolume(stream);
        } catch (CarNotConnectedException e) {
            Log.e(TAG, "Car is not connected", e);
            return 0;