1 /*
2  * Copyright (C) 2015 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.settings.fuelgauge;
18 
19 import android.os.BatteryStats;
20 import android.os.BatteryStats.Counter;
21 import android.os.BatteryStats.Timer;
22 import android.os.BatteryStats.Uid;
23 import android.util.ArrayMap;
24 import android.util.SparseArray;
25 
26 /**
27  * Fake UID for testing power usage screen.
28  */
29 public class FakeUid extends Uid {
30 
31     private final int mUid;
32 
FakeUid(int uid)33     public FakeUid(int uid) {
34         mUid = uid;
35     }
36 
37     @Override
getUid()38     public int getUid() {
39         return mUid;
40     }
41 
42     @Override
getWakelockStats()43     public ArrayMap<String, ? extends Wakelock> getWakelockStats() {
44         return null;
45     }
46 
47     @Override
getAggregatedPartialWakelockTimer()48     public Timer getAggregatedPartialWakelockTimer() {
49         return null;
50     }
51 
52     @Override
getSyncStats()53     public ArrayMap<String, ? extends Timer> getSyncStats() {
54         return null;
55     }
56 
57     @Override
getJobStats()58     public ArrayMap<String, ? extends Timer> getJobStats() {
59         return null;
60     }
61 
62     @Override
getSensorStats()63     public SparseArray<? extends Sensor> getSensorStats() {
64         return null;
65     }
66 
67     @Override
getPidStats()68     public SparseArray<? extends Pid> getPidStats() {
69         return null;
70     }
71 
72     @Override
getProcessStats()73     public ArrayMap<String, ? extends Proc> getProcessStats() {
74         return null;
75     }
76 
77     @Override
getPackageStats()78     public ArrayMap<String, ? extends Pkg> getPackageStats() {
79         return null;
80     }
81 
82     @Override
noteWifiRunningLocked(long elapsedRealtime)83     public void noteWifiRunningLocked(long elapsedRealtime) {
84     }
85 
86     @Override
noteWifiStoppedLocked(long elapsedRealtime)87     public void noteWifiStoppedLocked(long elapsedRealtime) {
88     }
89 
90     @Override
noteFullWifiLockAcquiredLocked(long elapsedRealtime)91     public void noteFullWifiLockAcquiredLocked(long elapsedRealtime) {
92     }
93 
94     @Override
noteFullWifiLockReleasedLocked(long elapsedRealtime)95     public void noteFullWifiLockReleasedLocked(long elapsedRealtime) {
96     }
97 
98     @Override
noteWifiScanStartedLocked(long elapsedRealtime)99     public void noteWifiScanStartedLocked(long elapsedRealtime) {
100     }
101 
102     @Override
noteWifiScanStoppedLocked(long elapsedRealtime)103     public void noteWifiScanStoppedLocked(long elapsedRealtime) {
104     }
105 
106     @Override
noteWifiBatchedScanStartedLocked(int csph, long elapsedRealtime)107     public void noteWifiBatchedScanStartedLocked(int csph, long elapsedRealtime) {
108     }
109 
110     @Override
noteWifiBatchedScanStoppedLocked(long elapsedRealtime)111     public void noteWifiBatchedScanStoppedLocked(long elapsedRealtime) {
112     }
113 
114     @Override
noteWifiMulticastEnabledLocked(long elapsedRealtime)115     public void noteWifiMulticastEnabledLocked(long elapsedRealtime) {
116     }
117 
118     @Override
noteWifiMulticastDisabledLocked(long elapsedRealtime)119     public void noteWifiMulticastDisabledLocked(long elapsedRealtime) {
120     }
121 
122     @Override
noteActivityResumedLocked(long elapsedRealtime)123     public void noteActivityResumedLocked(long elapsedRealtime) {
124     }
125 
126     @Override
noteActivityPausedLocked(long elapsedRealtime)127     public void noteActivityPausedLocked(long elapsedRealtime) {
128     }
129 
130     @Override
getWifiRunningTime(long elapsedRealtimeUs, int which)131     public long getWifiRunningTime(long elapsedRealtimeUs, int which) {
132         return 0;
133     }
134 
135     @Override
getFullWifiLockTime(long elapsedRealtimeUs, int which)136     public long getFullWifiLockTime(long elapsedRealtimeUs, int which) {
137         return 0;
138     }
139 
140     @Override
getWifiScanTime(long elapsedRealtimeUs, int which)141     public long getWifiScanTime(long elapsedRealtimeUs, int which) {
142         return 0;
143     }
144 
145     @Override
getWifiScanCount(int which)146     public int getWifiScanCount(int which) {
147         return 0;
148     }
149 
150     @Override
getWifiScanBackgroundCount(int which)151     public int getWifiScanBackgroundCount(int which)  {
152         return 0;
153     }
154 
155     @Override
getWifiScanActualTime(long elapsedRealtimeUs)156     public long getWifiScanActualTime(long elapsedRealtimeUs)  {
157         return 0;
158     }
159 
160     @Override
getWifiScanBackgroundTime(long elapsedRealtimeUs)161     public long getWifiScanBackgroundTime(long elapsedRealtimeUs)  {
162         return 0;
163     }
164 
165     @Override
getWifiBatchedScanTime(int csphBin, long elapsedRealtimeUs, int which)166     public long getWifiBatchedScanTime(int csphBin, long elapsedRealtimeUs, int which) {
167         return 0;
168     }
169 
170     @Override
getWifiBatchedScanCount(int csphBin, int which)171     public int getWifiBatchedScanCount(int csphBin, int which) {
172         return 0;
173     }
174 
175     @Override
getWifiMulticastTime(long elapsedRealtimeUs, int which)176     public long getWifiMulticastTime(long elapsedRealtimeUs, int which) {
177         return 0;
178     }
179 
180     @Override
getAudioTurnedOnTimer()181     public Timer getAudioTurnedOnTimer() {
182         return null;
183     }
184 
185     @Override
getVideoTurnedOnTimer()186     public Timer getVideoTurnedOnTimer() {
187         return null;
188     }
189 
190     @Override
getFlashlightTurnedOnTimer()191     public Timer getFlashlightTurnedOnTimer() {
192         return null;
193     }
194 
195     @Override
getCameraTurnedOnTimer()196     public Timer getCameraTurnedOnTimer() {
197         return null;
198     }
199 
200     @Override
getForegroundActivityTimer()201     public Timer getForegroundActivityTimer() {
202         return null;
203     }
204 
205     @Override
getProcessStateTime(int state, long elapsedRealtimeUs, int which)206     public long getProcessStateTime(int state, long elapsedRealtimeUs, int which) {
207         return 0;
208     }
209 
210     @Override
getProcessStateTimer(int state)211     public Timer getProcessStateTimer(int state) {
212         return null;
213     }
214 
215     @Override
getVibratorOnTimer()216     public Timer getVibratorOnTimer() {
217         return null;
218     }
219 
220     @Override
noteUserActivityLocked(int type)221     public void noteUserActivityLocked(int type) {
222     }
223 
224     @Override
hasUserActivity()225     public boolean hasUserActivity() {
226         return false;
227     }
228 
229     @Override
getUserActivityCount(int type, int which)230     public int getUserActivityCount(int type, int which) {
231         return 0;
232     }
233 
234     @Override
hasNetworkActivity()235     public boolean hasNetworkActivity() {
236         return false;
237     }
238 
239     @Override
getNetworkActivityBytes(int type, int which)240     public long getNetworkActivityBytes(int type, int which) {
241         return 0;
242     }
243 
244     @Override
getNetworkActivityPackets(int type, int which)245     public long getNetworkActivityPackets(int type, int which) {
246         return 0;
247     }
248 
249     @Override
getMobileRadioActiveTime(int which)250     public long getMobileRadioActiveTime(int which) {
251         return 0;
252     }
253 
254     @Override
getMobileRadioActiveCount(int which)255     public int getMobileRadioActiveCount(int which) {
256         return 0;
257     }
258 
259     @Override
getUserCpuTimeUs(int which)260     public long getUserCpuTimeUs(int which) {
261         return 0;
262     }
263 
264     @Override
getSystemCpuTimeUs(int which)265     public long getSystemCpuTimeUs(int which) {
266         return 0;
267     }
268 
269     @Override
getTimeAtCpuSpeed(int cluster, int step, int which)270     public long getTimeAtCpuSpeed(int cluster, int step, int which) {
271         return 0;
272     }
273 
274     @Override
getWifiControllerActivity()275     public BatteryStats.ControllerActivityCounter getWifiControllerActivity() {
276         return null;
277     }
278 
279     @Override
getBluetoothControllerActivity()280     public BatteryStats.ControllerActivityCounter getBluetoothControllerActivity() {
281         return null;
282     }
283 
284     @Override
getModemControllerActivity()285     public BatteryStats.ControllerActivityCounter getModemControllerActivity() {
286         return null;
287     }
288 
289     @Override
getBluetoothScanTimer()290     public Timer getBluetoothScanTimer() {
291         return null;
292     }
293 
294     @Override
getBluetoothScanBackgroundTimer()295     public Timer getBluetoothScanBackgroundTimer() {
296         return null;
297     }
298 
299     @Override
getBluetoothUnoptimizedScanTimer()300     public Timer getBluetoothUnoptimizedScanTimer() {
301         return null;
302     }
303 
304     @Override
getBluetoothUnoptimizedScanBackgroundTimer()305     public Timer getBluetoothUnoptimizedScanBackgroundTimer() {
306         return null;
307     }
308 
309     @Override
getBluetoothScanResultCounter()310     public Counter getBluetoothScanResultCounter() {
311         return null;
312     }
313 
314     @Override
getBluetoothScanResultBgCounter()315     public Counter getBluetoothScanResultBgCounter() {
316         return null;
317     }
318 
319     @Override
getWifiRadioApWakeupCount(int which)320     public long getWifiRadioApWakeupCount(int which) {
321         return 0;
322     }
323 
324     @Override
getMobileRadioApWakeupCount(int which)325     public long getMobileRadioApWakeupCount(int which) {
326         return 0;
327     }
328 
329     @Override
getCpuFreqTimes(int which)330     public long[] getCpuFreqTimes(int which) {
331         return null;
332     }
333 
334     @Override
getScreenOffCpuFreqTimes(int which)335     public long[] getScreenOffCpuFreqTimes(int which) {
336         return null;
337     }
338 }
339