Adrian Roos | ff2c456 | 2016-11-03 12:13:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
Adrian Roos | 2981eb0 | 2017-05-26 18:40:09 -0700 | [diff] [blame] | 19 | import android.os.PowerManager; |
Adrian Roos | ff2c456 | 2016-11-03 12:13:36 -0700 | [diff] [blame] | 20 | import android.view.Display; |
| 21 | |
| 22 | public class DozeServiceFake implements DozeMachine.Service { |
| 23 | |
| 24 | public boolean finished; |
| 25 | public int screenState; |
Adrian Roos | 4fb1f51 | 2017-02-14 14:01:32 +0100 | [diff] [blame] | 26 | public boolean requestedWakeup; |
Adrian Roos | 2981eb0 | 2017-05-26 18:40:09 -0700 | [diff] [blame] | 27 | public int screenBrightness; |
Adrian Roos | ff2c456 | 2016-11-03 12:13:36 -0700 | [diff] [blame] | 28 | |
| 29 | public DozeServiceFake() { |
| 30 | reset(); |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public void finish() { |
| 35 | finished = true; |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public void setDozeScreenState(int state) { |
| 40 | screenState = state; |
| 41 | } |
| 42 | |
Adrian Roos | 4fb1f51 | 2017-02-14 14:01:32 +0100 | [diff] [blame] | 43 | @Override |
| 44 | public void requestWakeUp() { |
| 45 | requestedWakeup = true; |
| 46 | } |
Adrian Roos | 2981eb0 | 2017-05-26 18:40:09 -0700 | [diff] [blame] | 47 | |
| 48 | @Override |
| 49 | public void setDozeScreenBrightness(int brightness) { |
| 50 | screenBrightness = brightness; |
| 51 | } |
| 52 | |
| 53 | public void reset() { |
| 54 | finished = false; |
| 55 | screenState = Display.STATE_UNKNOWN; |
| 56 | screenBrightness = PowerManager.BRIGHTNESS_DEFAULT; |
| 57 | } |
Adrian Roos | ff2c456 | 2016-11-03 12:13:36 -0700 | [diff] [blame] | 58 | } |