OSDN Git Service

AOD: Prewarm display while waiting for brightness sensor
[android-x86/frameworks-base.git] / packages / SystemUI / tests / src / com / android / systemui / doze / DozeHostFake.java
1 /*
2  * Copyright (C) 2017 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.doze;
18
19 import android.annotation.NonNull;
20 import android.app.PendingIntent;
21
22 /**
23  * A rudimentary fake for DozeHost.
24  */
25 class DozeHostFake implements DozeHost {
26     Callback callback;
27     boolean pulseAborted;
28     boolean pulseExtended;
29     boolean animateWakeup;
30     boolean dozing;
31     float doubleTapX;
32     float doubleTapY;
33     float aodDimmingScrimOpacity;
34
35     @Override
36     public void addCallback(@NonNull Callback callback) {
37         this.callback = callback;
38     }
39
40     @Override
41     public void removeCallback(@NonNull Callback callback) {
42         this.callback = null;
43     }
44
45     @Override
46     public void startDozing() {
47         dozing = true;
48     }
49
50     @Override
51     public void pulseWhileDozing(@NonNull PulseCallback callback, int reason) {
52         throw new RuntimeException("not implemented");
53     }
54
55     @Override
56     public void stopDozing() {
57         dozing = false;
58     }
59
60     @Override
61     public void dozeTimeTick() {
62         throw new RuntimeException("not implemented");
63     }
64
65     @Override
66     public boolean isPowerSaveActive() {
67         return false;
68     }
69
70     @Override
71     public boolean isPulsingBlocked() {
72         return false;
73     }
74
75     @Override
76     public boolean isProvisioned() {
77         return false;
78     }
79
80     @Override
81     public boolean isBlockingDoze() {
82         return false;
83     }
84
85     @Override
86     public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
87         throw new RuntimeException("not implemented");
88     }
89
90     @Override
91     public void onIgnoreTouchWhilePulsing(boolean ignore) {
92     }
93
94     @Override
95     public void abortPulsing() {
96         pulseAborted = true;
97     }
98
99     @Override
100     public void extendPulse() {
101         pulseExtended = true;
102     }
103
104     @Override
105     public void setAnimateWakeup(boolean animateWakeup) {
106         this.animateWakeup = animateWakeup;
107     }
108
109     @Override
110     public void onDoubleTap(float x, float y) {
111         doubleTapX = y;
112         doubleTapY = y;
113     }
114
115     @Override
116     public void setDozeScreenBrightness(int value) {
117     }
118
119     @Override
120     public void setAodDimmingScrim(float scrimOpacity) {
121         aodDimmingScrimOpacity = scrimOpacity;
122     }
123 }