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