1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.settingslib.volume.data.model
18 
19 import android.media.IVolumeController
20 
21 /** Models events received via [IVolumeController] */
22 sealed interface VolumeControllerEvent {
23 
24     /** @see [IVolumeController.displaySafeVolumeWarning] */
25     data class DisplaySafeVolumeWarning(val flags: Int) : VolumeControllerEvent
26 
27     /** @see [IVolumeController.volumeChanged] */
28     data class VolumeChanged(val streamType: Int, val flags: Int) : VolumeControllerEvent
29 
30     /** @see [IVolumeController.masterMuteChanged] */
31     data class MasterMuteChanged(val flags: Int) : VolumeControllerEvent
32 
33     /** @see [IVolumeController.setLayoutDirection] */
34     data class SetLayoutDirection(val layoutDirection: Int) : VolumeControllerEvent
35 
36     /** @see [IVolumeController.setA11yMode] */
37     data class SetA11yMode(val mode: Int) : VolumeControllerEvent
38 
39     /** @see [IVolumeController.displayCsdWarning] */
40     data class DisplayCsdWarning(
41         val csdWarning: Int,
42         val displayDurationMs: Int,
43     ) : VolumeControllerEvent
44 
45     /** @see [IVolumeController.dismiss] */
46     data object Dismiss : VolumeControllerEvent
47 }
48