1 /* 2 * Copyright (C) 2020 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.car.statusbar; 18 19 import com.android.systemui.dagger.SysUISingleton; 20 import com.android.systemui.doze.DozeHost; 21 22 import javax.inject.Inject; 23 24 /** No-op implementation of {@link DozeHost} for use by car sysui, which does not support dozing. */ 25 @SysUISingleton 26 public class DozeServiceHost implements DozeHost { 27 28 @Inject DozeServiceHost()29 public DozeServiceHost() {} 30 31 @Override addCallback(Callback callback)32 public void addCallback(Callback callback) { 33 // No op. 34 } 35 36 @Override removeCallback(Callback callback)37 public void removeCallback(Callback callback) { 38 // No op. 39 } 40 41 @Override startDozing()42 public void startDozing() { 43 // No op. 44 } 45 46 @Override pulseWhileDozing(PulseCallback callback, int reason)47 public void pulseWhileDozing(PulseCallback callback, int reason) { 48 // No op. 49 } 50 51 @Override stopDozing()52 public void stopDozing() { 53 // No op. 54 } 55 56 @Override dozeTimeTick()57 public void dozeTimeTick() { 58 // No op. 59 } 60 61 @Override isPowerSaveActive()62 public boolean isPowerSaveActive() { 63 return false; 64 } 65 66 @Override isPulsingBlocked()67 public boolean isPulsingBlocked() { 68 return true; 69 } 70 71 @Override isProvisioned()72 public boolean isProvisioned() { 73 return false; 74 } 75 76 @Override isBlockingDoze()77 public boolean isBlockingDoze() { 78 return true; 79 } 80 81 @Override extendPulse(int reason)82 public void extendPulse(int reason) { 83 // No op. 84 } 85 86 @Override setAnimateWakeup(boolean animateWakeup)87 public void setAnimateWakeup(boolean animateWakeup) { 88 // No op. 89 } 90 91 @Override onSlpiTap(float x, float y)92 public void onSlpiTap(float x, float y) { 93 // No op. 94 } 95 96 @Override setDozeScreenBrightness(int value)97 public void setDozeScreenBrightness(int value) { 98 // No op. 99 } 100 101 @Override prepareForGentleSleep(Runnable onDisplayOffCallback)102 public void prepareForGentleSleep(Runnable onDisplayOffCallback) { 103 // No op. 104 } 105 106 @Override cancelGentleSleep()107 public void cancelGentleSleep() { 108 // No op. 109 } 110 111 @Override onIgnoreTouchWhilePulsing(boolean ignore)112 public void onIgnoreTouchWhilePulsing(boolean ignore) { 113 // No op. 114 } 115 116 @Override stopPulsing()117 public void stopPulsing() { 118 // No op. 119 } 120 121 @Override isDozeSuppressed()122 public boolean isDozeSuppressed() { 123 return true; 124 } 125 } 126