OSDN Git Service

333e73dc10f49686a2a04992f90eb3121b3bde52
[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
34     @Override
35     public void addCallback(@NonNull Callback callback) {
36         this.callback = callback;
37     }
38
39     @Override
40     public void removeCallback(@NonNull Callback callback) {
41         this.callback = null;
42     }
43
44     @Override
45     public void startDozing() {
46         dozing = true;
47     }
48
49     @Override
50     public void pulseWhileDozing(@NonNull PulseCallback callback, int reason) {
51         throw new RuntimeException("not implemented");
52     }
53
54     @Override
55     public void stopDozing() {
56         dozing = false;
57     }
58
59     @Override
60     public void dozeTimeTick() {
61         throw new RuntimeException("not implemented");
62     }
63
64     @Override
65     public boolean isPowerSaveActive() {
66         return false;
67     }
68
69     @Override
70     public boolean isPulsingBlocked() {
71         return false;
72     }
73
74     @Override
75     public boolean isProvisioned() {
76         return false;
77     }
78
79     @Override
80     public boolean isBlockingDoze() {
81         return false;
82     }
83
84     @Override
85     public void startPendingIntentDismissingKeyguard(PendingIntent intent) {
86         throw new RuntimeException("not implemented");
87     }
88
89     @Override
90     public void onIgnoreTouchWhilePulsing(boolean ignore) {
91     }
92
93     @Override
94     public void abortPulsing() {
95         pulseAborted = true;
96     }
97
98     @Override
99     public void extendPulse() {
100         pulseExtended = true;
101     }
102
103     @Override
104     public void setAnimateWakeup(boolean animateWakeup) {
105         this.animateWakeup = animateWakeup;
106     }
107
108     @Override
109     public void onDoubleTap(float x, float y) {
110         doubleTapX = y;
111         doubleTapY = y;
112     }
113
114     @Override
115     public void setDozeScreenBrightness(int value) {
116     }
117 }