Loading packages/SystemUI/src/com/android/systemui/qs/user/UserSwitchDialogController.kt +1 −13 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.QSUserSwitcherEvent import com.android.systemui.qs.tiles.UserDetailView import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.user.ui.dialog.DialogShowerImpl import javax.inject.Inject import javax.inject.Provider Loading Loading @@ -130,19 +131,6 @@ class UserSwitchDialogController @VisibleForTesting constructor( } } private class DialogShowerImpl( private val animateFrom: Dialog, private val dialogLaunchAnimator: DialogLaunchAnimator ) : DialogInterface by animateFrom, DialogShower { override fun showDialog(dialog: Dialog, cuj: DialogCuj) { dialogLaunchAnimator.showFromDialog( dialog, animateFrom = animateFrom, cuj ) } } interface DialogShower : DialogInterface { fun showDialog(dialog: Dialog, cuj: DialogCuj) } Loading packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt +2 −4 Original line number Diff line number Diff line Loading @@ -115,9 +115,7 @@ constructor( private val callbackMutex = Mutex() private val callbacks = mutableSetOf<UserCallback>() private val userInfos: Flow<List<UserInfo>> = repository.userInfos.map { userInfos -> userInfos.filter { it.isFull } } repository.userInfos.map { userInfos -> userInfos.filter { it.isFull } } /** List of current on-device users to select from. */ val users: Flow<List<UserModel>> Loading Loading @@ -493,7 +491,7 @@ constructor( fun showUserSwitcher(context: Context, expandable: Expandable) { if (!featureFlags.isEnabled(Flags.FULL_SCREEN_USER_SWITCHER)) { showDialog(ShowDialogRequestModel.ShowUserSwitcherDialog) showDialog(ShowDialogRequestModel.ShowUserSwitcherDialog(expandable)) return } Loading packages/SystemUI/src/com/android/systemui/user/domain/model/ShowDialogRequestModel.kt +5 −1 Original line number Diff line number Diff line Loading @@ -18,11 +18,13 @@ package com.android.systemui.user.domain.model import android.os.UserHandle import com.android.systemui.animation.Expandable import com.android.systemui.qs.user.UserSwitchDialogController /** Encapsulates a request to show a dialog. */ sealed class ShowDialogRequestModel( open val dialogShower: UserSwitchDialogController.DialogShower? = null, open val expandable: Expandable? = null, ) { data class ShowAddUserDialog( val userHandle: UserHandle, Loading @@ -45,5 +47,7 @@ sealed class ShowDialogRequestModel( ) : ShowDialogRequestModel(dialogShower) /** Show the user switcher dialog */ object ShowUserSwitcherDialog : ShowDialogRequestModel() data class ShowUserSwitcherDialog( override val expandable: Expandable?, ) : ShowDialogRequestModel() } packages/SystemUI/src/com/android/systemui/user/ui/dialog/DialogShowerImpl.kt 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.user.ui.dialog import android.app.Dialog import android.content.DialogInterface import com.android.systemui.animation.DialogCuj import com.android.systemui.animation.DialogLaunchAnimator import com.android.systemui.qs.user.UserSwitchDialogController.DialogShower /** Extracted from [UserSwitchDialogController] */ class DialogShowerImpl( private val animateFrom: Dialog, private val dialogLaunchAnimator: DialogLaunchAnimator, ) : DialogInterface by animateFrom, DialogShower { override fun showDialog(dialog: Dialog, cuj: DialogCuj) { dialogLaunchAnimator.showFromDialog(dialog, animateFrom = animateFrom, cuj) } } packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitchDialog.kt +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ class UserSwitchDialog( setView(gridFrame) adapter.linkToViewGroup(gridFrame.findViewById(R.id.grid)) adapter.injectDialogShower(DialogShowerImpl(this, dialogLaunchAnimator)) } companion object { Loading Loading
packages/SystemUI/src/com/android/systemui/qs/user/UserSwitchDialogController.kt +1 −13 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.QSUserSwitcherEvent import com.android.systemui.qs.tiles.UserDetailView import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.user.ui.dialog.DialogShowerImpl import javax.inject.Inject import javax.inject.Provider Loading Loading @@ -130,19 +131,6 @@ class UserSwitchDialogController @VisibleForTesting constructor( } } private class DialogShowerImpl( private val animateFrom: Dialog, private val dialogLaunchAnimator: DialogLaunchAnimator ) : DialogInterface by animateFrom, DialogShower { override fun showDialog(dialog: Dialog, cuj: DialogCuj) { dialogLaunchAnimator.showFromDialog( dialog, animateFrom = animateFrom, cuj ) } } interface DialogShower : DialogInterface { fun showDialog(dialog: Dialog, cuj: DialogCuj) } Loading
packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt +2 −4 Original line number Diff line number Diff line Loading @@ -115,9 +115,7 @@ constructor( private val callbackMutex = Mutex() private val callbacks = mutableSetOf<UserCallback>() private val userInfos: Flow<List<UserInfo>> = repository.userInfos.map { userInfos -> userInfos.filter { it.isFull } } repository.userInfos.map { userInfos -> userInfos.filter { it.isFull } } /** List of current on-device users to select from. */ val users: Flow<List<UserModel>> Loading Loading @@ -493,7 +491,7 @@ constructor( fun showUserSwitcher(context: Context, expandable: Expandable) { if (!featureFlags.isEnabled(Flags.FULL_SCREEN_USER_SWITCHER)) { showDialog(ShowDialogRequestModel.ShowUserSwitcherDialog) showDialog(ShowDialogRequestModel.ShowUserSwitcherDialog(expandable)) return } Loading
packages/SystemUI/src/com/android/systemui/user/domain/model/ShowDialogRequestModel.kt +5 −1 Original line number Diff line number Diff line Loading @@ -18,11 +18,13 @@ package com.android.systemui.user.domain.model import android.os.UserHandle import com.android.systemui.animation.Expandable import com.android.systemui.qs.user.UserSwitchDialogController /** Encapsulates a request to show a dialog. */ sealed class ShowDialogRequestModel( open val dialogShower: UserSwitchDialogController.DialogShower? = null, open val expandable: Expandable? = null, ) { data class ShowAddUserDialog( val userHandle: UserHandle, Loading @@ -45,5 +47,7 @@ sealed class ShowDialogRequestModel( ) : ShowDialogRequestModel(dialogShower) /** Show the user switcher dialog */ object ShowUserSwitcherDialog : ShowDialogRequestModel() data class ShowUserSwitcherDialog( override val expandable: Expandable?, ) : ShowDialogRequestModel() }
packages/SystemUI/src/com/android/systemui/user/ui/dialog/DialogShowerImpl.kt 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.user.ui.dialog import android.app.Dialog import android.content.DialogInterface import com.android.systemui.animation.DialogCuj import com.android.systemui.animation.DialogLaunchAnimator import com.android.systemui.qs.user.UserSwitchDialogController.DialogShower /** Extracted from [UserSwitchDialogController] */ class DialogShowerImpl( private val animateFrom: Dialog, private val dialogLaunchAnimator: DialogLaunchAnimator, ) : DialogInterface by animateFrom, DialogShower { override fun showDialog(dialog: Dialog, cuj: DialogCuj) { dialogLaunchAnimator.showFromDialog(dialog, animateFrom = animateFrom, cuj) } }
packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitchDialog.kt +1 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ class UserSwitchDialog( setView(gridFrame) adapter.linkToViewGroup(gridFrame.findViewById(R.id.grid)) adapter.injectDialogShower(DialogShowerImpl(this, dialogLaunchAnimator)) } companion object { Loading