/frameworks/base/packages/SettingsLib/src/com/android/settingslib/fuelgauge/ |
D | BatteryStatus.java | 19 import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; 20 import static android.os.BatteryManager.BATTERY_STATUS_FULL; 21 import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; 22 import static android.os.BatteryManager.EXTRA_HEALTH; 23 import static android.os.BatteryManager.EXTRA_LEVEL; 24 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT; 25 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE; 26 import static android.os.BatteryManager.EXTRA_PLUGGED; 27 import static android.os.BatteryManager.EXTRA_STATUS; 31 import android.os.BatteryManager; [all …]
|
/frameworks/base/packages/SettingsProvider/src/android/provider/settings/validators/ |
D | GlobalSettingsValidators.java | 26 import android.os.BatteryManager; 52 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put() 53 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put() 54 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put() 56 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 57 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put() 59 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 60 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() 62 == (BatteryManager.BATTERY_PLUGGED_USB in VALIDATORS.put() 63 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() [all …]
|
D | SystemSettingsValidators.java | 31 import android.os.BatteryManager; 57 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put() 58 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put() 59 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put() 61 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 62 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put() 64 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 65 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() 67 == (BatteryManager.BATTERY_PLUGGED_USB in VALIDATORS.put() 68 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() [all …]
|
/frameworks/base/services/core/java/com/android/server/ |
D | BatteryService.java | 37 import android.os.BatteryManager; 333 if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked() 336 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 && mHealthInfo.chargerAcOnline) { in isPoweredLocked() 339 … if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 && mHealthInfo.chargerUsbOnline) { in isPoweredLocked() 342 …if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mHealthInfo.chargerWirelessOnl… in isPoweredLocked() 359 && mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked() 381 return mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING; in shouldShutdownLocked() 471 mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in processValuesLocked() 474 mPlugType = BatteryManager.BATTERY_PLUGGED_AC; in processValuesLocked() 476 mPlugType = BatteryManager.BATTERY_PLUGGED_USB; in processValuesLocked() [all …]
|
D | CachedDeviceStateService.java | 23 import android.os.BatteryManager; 46 intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,
|
/frameworks/base/cmds/svc/src/com/android/commands/svc/ |
D | PowerCommand.java | 20 import android.os.BatteryManager; 69 val = BatteryManager.BATTERY_PLUGGED_AC | in run() 70 BatteryManager.BATTERY_PLUGGED_USB | in run() 71 BatteryManager.BATTERY_PLUGGED_WIRELESS; in run() 76 val = BatteryManager.BATTERY_PLUGGED_USB; in run() 78 val = BatteryManager.BATTERY_PLUGGED_AC; in run() 80 val = BatteryManager.BATTERY_PLUGGED_WIRELESS; in run()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/ |
D | BatteryControllerImpl.java | 23 import android.os.BatteryManager; 159 * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0) in onReceive() 160 / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100)); in onReceive() 161 mPluggedIn = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0; in onReceive() 163 final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 164 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 165 mCharged = status == BatteryManager.BATTERY_STATUS_FULL; in onReceive() 166 mCharging = mCharged || status == BatteryManager.BATTERY_STATUS_CHARGING; in onReceive() 188 dummy.putExtra("plugged", incr > 0 ? BatteryManager.BATTERY_PLUGGED_AC in onReceive()
|
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/controllers/ |
D | BatteryController.java | 25 import android.os.BatteryManager; 145 filter.addAction(BatteryManager.ACTION_CHARGING); in startTracking() 146 filter.addAction(BatteryManager.ACTION_DISCHARGING); in startTracking() 153 mCharging = batteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); in startTracking() 218 } else if (BatteryManager.ACTION_CHARGING.equals(action)) { in onReceiveInternal() 225 } else if (BatteryManager.ACTION_DISCHARGING.equals(action)) { in onReceiveInternal() 232 mLastBatterySeq = intent.getIntExtra(BatteryManager.EXTRA_SEQUENCE, in onReceiveInternal()
|
/frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/ |
D | UpdateInstaller.java | 26 import android.os.BatteryManager; 94 batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, /* defaultValue= */ -1) > 0; in isBatteryLevelSufficient() 101 int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, /* defaultValue= */ -1); in calculateBatteryPercentage() 102 int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, /* defaultValue= */ -1); in calculateBatteryPercentage()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/net/ |
D | ConnOnActivityStartTest.java | 28 import android.os.BatteryManager; 93 private static BatteryManager mBatteryManager; 107 mBatteryManager = (BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE); in setUpOnce() 293 executeCommand("cmd battery set status " + BatteryManager.BATTERY_STATUS_NOT_CHARGING); in turnBatteryOn() 306 executeCommand("cmd battery set ac " + BatteryManager.BATTERY_PLUGGED_AC); in turnBatteryOff() 307 executeCommand("cmd battery set status " + BatteryManager.BATTERY_STATUS_CHARGING); in turnBatteryOff()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
D | CachedDeviceStateServiceTest.java | 26 import android.os.BatteryManager; 131 intentPluggedIn.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_AC); in correctlyReportsCharging() 136 intentUnplugged.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_NONE); in correctlyReportsCharging() 166 intentPluggedIn.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_AC); in correctlyTracksTimeOnBattery()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/power/ |
D | PowerUI.java | 27 import android.os.BatteryManager; 105 @VisibleForTesting int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; 264 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive() 266 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 267 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 269 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive() 271 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive() 438 || snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN) { in shouldShowHybridWarning() 441 + (snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN)); in shouldShowHybridWarning() 500 && currentSnapshot.getBatteryStatus() != BatteryManager.BATTERY_STATUS_UNKNOWN; in shouldShowLowBatteryWarning()
|
/frameworks/base/core/java/android/os/ |
D | BatteryManager.java | 37 public class BatteryManager { class 262 public BatteryManager() { in BatteryManager() method in BatteryManager 271 public BatteryManager(Context context, in BatteryManager() method in BatteryManager
|
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/ |
D | UtilsTest.java | 34 import android.os.BatteryManager; 320 final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_LEVEL, 100); in getBatteryStatus_statusIsFull_returnFullString() 329 final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus_batteryLevelIs100_returnFullString() 330 BatteryManager.BATTERY_STATUS_FULL); in getBatteryStatus_batteryLevelIs100_returnFullString() 339 final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus_batteryLevel99_returnChargingString() 340 BatteryManager.BATTERY_STATUS_CHARGING); in getBatteryStatus_batteryLevel99_returnChargingString()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/power/ |
D | PowerUITest.java | 33 import android.os.BatteryManager; 400 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_lowLevelWarning() 404 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_lowLevelWarning() 465 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_severeLevelWarning() 469 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_severeLevelWarning() 542 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 552 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, 0, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 596 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowStandardWarning() 600 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowStandardWarning() 708 public int mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD;
|
D | PowerNotificationWarningsTest.java | 33 import android.os.BatteryManager; 64 BatteryManager.BATTERY_HEALTH_GOOD, 5, 15); in setUp()
|
/frameworks/base/services/core/java/com/android/server/storage/ |
D | DiskStatsLoggingService.java | 28 import android.os.BatteryManager; 109 BatteryManager batteryManager = in isCharging() 110 (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE); in isCharging()
|
/frameworks/base/apct-tests/perftests/windowmanager/src/android/wm/ |
D | WindowManagerPerfTestBase.java | 26 import android.os.BatteryManager; 69 if (stayOnWhilePluggedIn != BatteryManager.BATTERY_PLUGGED_ANY) { in setUpOnce() 72 setStayOnWhilePluggedIn(BatteryManager.BATTERY_PLUGGED_ANY); in setUpOnce()
|
/frameworks/opt/telephony/src/java/com/android/internal/telephony/ |
D | DeviceStateMonitor.java | 36 import android.os.BatteryManager; 233 case BatteryManager.ACTION_CHARGING: 237 case BatteryManager.ACTION_DISCHARGING: 299 filter.addAction(BatteryManager.ACTION_CHARGING); in DeviceStateMonitor() 300 filter.addAction(BatteryManager.ACTION_DISCHARGING); in DeviceStateMonitor() 693 final BatteryManager bm = (BatteryManager) mPhone.getContext().getSystemService( in isDeviceCharging()
|
/frameworks/base/services/core/java/com/android/server/power/ |
D | WirelessChargerDetector.java | 23 import android.os.BatteryManager; 223 if (isPowered && plugType == BatteryManager.BATTERY_PLUGGED_WIRELESS) { in update() 234 if (plugType != 0 && plugType != BatteryManager.BATTERY_PLUGGED_WIRELESS) { in update()
|
/frameworks/base/tests/BatteryWaster/src/com/android/batterywaster/ |
D | BatteryWaster.java | 24 import android.os.BatteryManager; 173 int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
/frameworks/base/core/proto/android/os/ |
D | enums.proto | 24 // They are primarily used by android/os/BatteryManager.java. 36 // Plug states, primarily used by android/os/BatteryManager.java. 38 // Note that NONE is not in BatteryManager.java's constants. 49 // They are primarily used by android/os/BatteryManager.java.
|
/frameworks/base/services/tests/servicestests/src/com/android/server/storage/ |
D | DiskStatsLoggingServiceTest.java | 38 import android.os.BatteryManager; 180 BatteryManager batteryManager = mock(BatteryManager.class); in testDontCrashOnRun()
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/ |
D | DeviceStateMonitorTest.java | 38 import android.os.BatteryManager; 268 Intent intent = new Intent(BatteryManager.ACTION_CHARGING); in testCharging() 278 intent = new Intent(BatteryManager.ACTION_DISCHARGING); in testCharging()
|
/frameworks/base/services/core/java/com/android/server/pm/ |
D | BackgroundDexOptService.java | 32 import android.os.BatteryManager; 156 int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); in getBatteryLevel() 157 int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); in getBatteryLevel() 158 boolean present = intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true); in getBatteryLevel()
|