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