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

Commit d8ce3006 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

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

This CL changes nothing but method name. A following CL should either
remove or refactor the CarVolumeDialogController class as we are moving
to use AudioAttributes usage instead of stream_type.

Bug: 28469751
Test: lunch bat_land-userdebug && m -j // Then flash and open the app
Change-Id: Ic3c657ed36d67fbbc18b6787b04bff147ee693a2
parent 64f62938
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;