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.systemui.volume.dialog.domain.model 18 19 import android.media.AudioManager 20 import com.android.systemui.plugins.VolumeDialogController 21 22 /** 23 * Models VolumeDialogController callback events. 24 * 25 * @see VolumeDialogController.Callbacks 26 */ 27 sealed interface VolumeDialogEventModel { 28 29 data class ShowRequested( 30 val reason: Int, 31 val keyguardLocked: Boolean, 32 val lockTaskModeState: Int, 33 ) : VolumeDialogEventModel 34 35 data class DismissRequested(val reason: Int) : VolumeDialogEventModel 36 37 data class StateChanged(val state: VolumeDialogController.State) : VolumeDialogEventModel 38 39 data class LayoutDirectionChanged(val layoutDirection: Int) : VolumeDialogEventModel 40 41 data object ScreenOff : VolumeDialogEventModel 42 43 data class ShowSafetyWarning(val flags: Int) : VolumeDialogEventModel 44 45 data class AccessibilityModeChanged(val showA11yStream: Boolean) : VolumeDialogEventModel 46 47 data class ShowCsdWarning(@AudioManager.CsdWarning val csdWarning: Int, val durationMs: Int) : 48 VolumeDialogEventModel 49 50 data object VolumeChangedFromKey : VolumeDialogEventModel 51 52 /** 53 * Signals that the 54 * [com.android.systemui.volume.dialog.domain.interactor.VolumeDialogCallbacksInteractor] is 55 * ready to process the events. 56 */ 57 data object SubscribedToEvents : VolumeDialogEventModel 58 } 59