• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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.keyguard.ui.viewmodel
19 
20 import com.android.systemui.dagger.SysUISingleton
21 import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
22 import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
23 import com.android.systemui.keyguard.shared.model.Edge
24 import com.android.systemui.keyguard.shared.model.KeyguardState.AOD
25 import com.android.systemui.keyguard.shared.model.KeyguardState.GONE
26 import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN
27 import com.android.systemui.scene.shared.model.Scenes
28 import javax.inject.Inject
29 import kotlinx.coroutines.ExperimentalCoroutinesApi
30 
31 @OptIn(ExperimentalCoroutinesApi::class)
32 @SysUISingleton
33 class KeyguardJankViewModel
34 @Inject
35 constructor(
36     private val keyguardInteractor: KeyguardInteractor,
37     private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
38 ) {
39     val goneToAodTransition =
40         keyguardTransitionInteractor.transition(
41             edge = Edge.create(Scenes.Gone, AOD),
42             edgeWithoutSceneContainer = Edge.create(GONE, AOD),
43         )
44 
45     val lockscreenToAodTransition =
46         keyguardTransitionInteractor.transition(
47             edge = Edge.create(Scenes.Lockscreen, AOD),
48             edgeWithoutSceneContainer = Edge.create(LOCKSCREEN, AOD),
49         )
50 
51     val aodToLockscreenTransition =
52         keyguardTransitionInteractor.transition(
53             edge = Edge.create(AOD, Scenes.Lockscreen),
54             edgeWithoutSceneContainer = Edge.create(AOD, LOCKSCREEN),
55         )
56 }
57