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 package com.android.systemui.keyguard.shared.model
17 
18 /** Model device doze states. */
19 enum class DozeStateModel {
20     /** Default state. Transition to INITIALIZED to get Doze going. */
21     UNINITIALIZED,
22     /** Doze components are set up. Followed by transition to DOZE or DOZE_AOD. */
23     INITIALIZED,
24     /** Regular doze. Device is asleep and listening for pulse triggers. */
25     DOZE,
26     /** Deep doze. Device is asleep and is not listening for pulse triggers. */
27     DOZE_SUSPEND_TRIGGERS,
28     /** Always-on doze. Device is asleep, showing UI and listening for pulse triggers. */
29     DOZE_AOD,
30     /** Pulse has been requested. Device is awake and preparing UI */
31     DOZE_REQUEST_PULSE,
32     /** Pulse is showing. Device is awake and showing UI. */
33     DOZE_PULSING,
34     /** Pulse is showing with bright wallpaper. Device is awake and showing UI. */
35     DOZE_PULSING_BRIGHT,
36     /** Pulse is done showing. Followed by transition to DOZE or DOZE_AOD. */
37     DOZE_PULSE_DONE,
38     /** Doze is done. DozeService is finished. */
39     FINISH,
40     /** AOD, but the display is temporarily off. */
41     DOZE_AOD_PAUSED,
42     /** AOD, prox is near, transitions to DOZE_AOD_PAUSED after a timeout. */
43     DOZE_AOD_PAUSING,
44     /** Always-on doze. Device is awake, showing docking UI and listening for pulse triggers. */
45     DOZE_AOD_DOCKED;
46 
47     companion object {
isDozeOffnull48         fun isDozeOff(model: DozeStateModel): Boolean {
49             return model == UNINITIALIZED || model == FINISH
50         }
51     }
52 }
53