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