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