• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 
18 package com.android.systemui.user.domain.model
19 
20 import android.os.UserHandle
21 import com.android.systemui.animation.Expandable
22 import com.android.systemui.qs.user.UserSwitchDialogController
23 
24 /** Encapsulates a request to show a dialog. */
25 sealed class ShowDialogRequestModel(
26     open val dialogShower: UserSwitchDialogController.DialogShower? = null,
27     open val expandable: Expandable? = null,
28 ) {
29     data class ShowAddUserDialog(
30         val userHandle: UserHandle,
31         val isKeyguardShowing: Boolean,
32         val showEphemeralMessage: Boolean,
33         override val dialogShower: UserSwitchDialogController.DialogShower?,
34     ) : ShowDialogRequestModel(dialogShower)
35 
36     data class ShowUserCreationDialog(
37         val isGuest: Boolean,
38     ) : ShowDialogRequestModel()
39 
40     data class ShowExitGuestDialog(
41         val guestUserId: Int,
42         val targetUserId: Int,
43         val isGuestEphemeral: Boolean,
44         val isKeyguardShowing: Boolean,
45         val onExitGuestUser: (guestId: Int, targetId: Int, forceRemoveGuest: Boolean) -> Unit,
46         override val dialogShower: UserSwitchDialogController.DialogShower?,
47     ) : ShowDialogRequestModel(dialogShower)
48 
49     /** Show the user switcher dialog */
50     data class ShowUserSwitcherDialog(
51         override val expandable: Expandable?,
52     ) : ShowDialogRequestModel()
53 
54     data class ShowUserSwitcherFullscreenDialog(
55         override val expandable: Expandable?,
56     ) : ShowDialogRequestModel()
57 }
58