1 /*
2  * Copyright (C) 2012 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.layoutlib.bridge.android;
18 
19 import android.os.IBinder;
20 import android.os.IPowerManager;
21 import android.os.RemoteException;
22 import android.os.WorkSource;
23 
24 /**
25  * Fake implementation of IPowerManager.
26  *
27  */
28 public class BridgePowerManager implements IPowerManager {
29 
30     @Override
isInteractive()31     public boolean isInteractive() throws RemoteException {
32         return true;
33     }
34 
35     @Override
isPowerSaveMode()36     public boolean isPowerSaveMode() throws RemoteException {
37         return false;
38     }
39 
40     @Override
setPowerSaveMode(boolean mode)41     public boolean setPowerSaveMode(boolean mode) throws RemoteException {
42         return false;
43     }
44 
45     @Override
asBinder()46     public IBinder asBinder() {
47         // pass for now.
48         return null;
49     }
50 
51     @Override
acquireWakeLock(IBinder arg0, int arg1, String arg2, String arg2_5, WorkSource arg3, String arg4)52     public void acquireWakeLock(IBinder arg0, int arg1, String arg2, String arg2_5, WorkSource arg3, String arg4)
53             throws RemoteException {
54         // pass for now.
55     }
56 
57     @Override
acquireWakeLockWithUid(IBinder arg0, int arg1, String arg2, String arg2_5, int arg3)58     public void acquireWakeLockWithUid(IBinder arg0, int arg1, String arg2, String arg2_5, int arg3)
59             throws RemoteException {
60         // pass for now.
61     }
62 
63     @Override
powerHint(int hintId, int data)64     public void powerHint(int hintId, int data) {
65         // pass for now.
66     }
67 
68     @Override
crash(String arg0)69     public void crash(String arg0) throws RemoteException {
70         // pass for now.
71     }
72 
73     @Override
goToSleep(long arg0, int arg1, int arg2)74     public void goToSleep(long arg0, int arg1, int arg2) throws RemoteException {
75         // pass for now.
76     }
77 
78     @Override
nap(long arg0)79     public void nap(long arg0) throws RemoteException {
80         // pass for now.
81     }
82 
83     @Override
reboot(boolean confirm, String reason, boolean wait)84     public void reboot(boolean confirm, String reason, boolean wait) {
85         // pass for now.
86     }
87 
88     @Override
rebootSafeMode(boolean confirm, boolean wait)89     public void rebootSafeMode(boolean confirm, boolean wait) {
90         // pass for now.
91     }
92 
93     @Override
shutdown(boolean confirm, String reason, boolean wait)94     public void shutdown(boolean confirm, String reason, boolean wait) {
95         // pass for now.
96     }
97 
98     @Override
releaseWakeLock(IBinder arg0, int arg1)99     public void releaseWakeLock(IBinder arg0, int arg1) throws RemoteException {
100         // pass for now.
101     }
102 
103     @Override
updateWakeLockUids(IBinder arg0, int[] arg1)104     public void updateWakeLockUids(IBinder arg0, int[] arg1) throws RemoteException {
105         // pass for now.
106     }
107 
108     @Override
setAttentionLight(boolean arg0, int arg1)109     public void setAttentionLight(boolean arg0, int arg1) throws RemoteException {
110         // pass for now.
111     }
112 
113     @Override
setTemporaryScreenAutoBrightnessAdjustmentSettingOverride(float arg0)114     public void setTemporaryScreenAutoBrightnessAdjustmentSettingOverride(float arg0) throws RemoteException {
115         // pass for now.
116     }
117 
118     @Override
setTemporaryScreenBrightnessSettingOverride(int arg0)119     public void setTemporaryScreenBrightnessSettingOverride(int arg0) throws RemoteException {
120         // pass for now.
121     }
122 
123     @Override
setStayOnSetting(int arg0)124     public void setStayOnSetting(int arg0) throws RemoteException {
125         // pass for now.
126     }
127 
128     @Override
updateWakeLockWorkSource(IBinder arg0, WorkSource arg1, String arg2)129     public void updateWakeLockWorkSource(IBinder arg0, WorkSource arg1, String arg2) throws RemoteException {
130         // pass for now.
131     }
132 
133     @Override
isWakeLockLevelSupported(int level)134     public boolean isWakeLockLevelSupported(int level) throws RemoteException {
135         // pass for now.
136         return true;
137     }
138 
139     @Override
userActivity(long time, int event, int flags)140     public void userActivity(long time, int event, int flags) throws RemoteException {
141         // pass for now.
142     }
143 
144     @Override
wakeUp(long time, String reason, String opPackageName)145     public void wakeUp(long time, String reason, String opPackageName) throws RemoteException {
146         // pass for now.
147     }
148 
149     @Override
boostScreenBrightness(long time)150     public void boostScreenBrightness(long time) throws RemoteException {
151         // pass for now.
152     }
153 
154     @Override
isDeviceIdleMode()155     public boolean isDeviceIdleMode() throws RemoteException {
156         return false;
157     }
158 
159     @Override
isLightDeviceIdleMode()160     public boolean isLightDeviceIdleMode() throws RemoteException {
161         return false;
162     }
163 
164     @Override
isScreenBrightnessBoosted()165     public boolean isScreenBrightnessBoosted() throws RemoteException {
166         return false;
167     }
168 }
169