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 31 @Override 32 public void addCallback(@NonNull Callback callback) { 33 this.callback = callback; 34 } 35 36 @Override 37 public void removeCallback(@NonNull Callback callback) { 38 this.callback = null; 39 } 40 41 @Override 42 public void startDozing() { 43 throw new RuntimeException("not implemented"); 44 } 45 46 @Override 47 public void pulseWhileDozing(@NonNull PulseCallback callback, int reason) { 48 throw new RuntimeException("not implemented"); 49 } 50 51 @Override 52 public void stopDozing() { 53 throw new RuntimeException("not implemented"); 54 } 55 56 @Override 57 public void dozeTimeTick() { 58 throw new RuntimeException("not implemented"); 59 } 60 61 @Override 62 public boolean isPowerSaveActive() { 63 return false; 64 } 65 66 @Override 67 public boolean isPulsingBlocked() { 68 return false; 69 } 70 71 @Override 72 public void startPendingIntentDismissingKeyguard(PendingIntent intent) { 73 throw new RuntimeException("not implemented"); 74 } 75 76 @Override 77 public void abortPulsing() { 78 pulseAborted = true; 79 } 80 81 @Override 82 public void extendPulse() { 83 pulseExtended = true; 84 } 85 86 @Override 87 public void setAnimateWakeup(boolean animateWakeup) { 88 this.animateWakeup = animateWakeup; 89 } 90 } 91