/frameworks/base/packages/SettingsLib/src/com/android/settingslib/fuelgauge/ |
D | BatteryStatus.java | 19 import static android.os.BatteryManager.BATTERY_HEALTH_OVERHEAT; 20 import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; 21 import static android.os.BatteryManager.BATTERY_STATUS_FULL; 22 import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; 23 import static android.os.BatteryManager.EXTRA_HEALTH; 24 import static android.os.BatteryManager.EXTRA_LEVEL; 25 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT; 26 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE; 27 import static android.os.BatteryManager.EXTRA_PLUGGED; 28 import static android.os.BatteryManager.EXTRA_PRESENT; [all …]
|
/frameworks/base/core/java/android/hardware/ |
D | BatteryState.java | 21 import android.os.BatteryManager; 43 public static final int STATUS_UNKNOWN = BatteryManager.BATTERY_STATUS_UNKNOWN; 45 public static final int STATUS_CHARGING = BatteryManager.BATTERY_STATUS_CHARGING; 47 public static final int STATUS_DISCHARGING = BatteryManager.BATTERY_STATUS_DISCHARGING; 49 public static final int STATUS_NOT_CHARGING = BatteryManager.BATTERY_STATUS_NOT_CHARGING; 51 public static final int STATUS_FULL = BatteryManager.BATTERY_STATUS_FULL;
|
/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_LEVEL, 100); in getBatteryStatus_statusIsFullAndUseCompactStatus_returnFullyChargedString() 338 final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus_batteryLevelIs100_returnFullString() 339 BatteryManager.BATTERY_STATUS_FULL); in getBatteryStatus_batteryLevelIs100_returnFullString() 348 final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus_batteryLevelIs100AndUseCompactStatus_returnFullyString() 349 BatteryManager.BATTERY_STATUS_FULL); in getBatteryStatus_batteryLevelIs100AndUseCompactStatus_returnFullyString() 359 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in getBatteryStatus_batteryLevel99_returnChargingString() 360 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_USB); in getBatteryStatus_batteryLevel99_returnChargingString() 370 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in getBatteryStatus_chargingDock_returnDockChargingString() [all …]
|
/frameworks/base/core/tests/coretests/src/com/android/internal/os/ |
D | BatteryChargeCalculatorTest.java | 22 import android.os.BatteryManager; 47 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals() 50 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals() 53 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals() 74 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_CHARGING, 100, in testDischargeTotals() 75 BatteryManager.BATTERY_PLUGGED_USB, 80, 72, 3700, 2_400_000, 4_000_000, 100, in testDischargeTotals() 89 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable() 92 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable() 95 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable()
|
D | BatteryStatsHistoryIteratorTest.java | 21 import android.os.BatteryManager; 61 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testIterator() 64 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testIterator() 121 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in tagsLongHistory()
|
D | BatteryInputSuspendTest.java | 25 import android.os.BatteryManager; 111 return batteryMonitor.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0; in isCharging()
|
/frameworks/base/services/core/java/com/android/server/ |
D | BatteryService.java | 32 import android.os.BatteryManager; 323 if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked() 326 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 in isPoweredLocked() 330 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 in isPoweredLocked() 334 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 in isPoweredLocked() 338 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_DOCK) != 0 in isPoweredLocked() 356 && mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked() 379 return mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING; in shouldShutdownLocked() 447 return BatteryManager.BATTERY_PLUGGED_AC; in plugType() 449 return BatteryManager.BATTERY_PLUGGED_USB; in plugType() [all …]
|
D | CachedDeviceStateService.java | 23 import android.os.BatteryManager; 46 intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ |
D | BatteryControllerTest.java | 19 import static android.os.BatteryManager.EXTRA_PRESENT; 31 import android.os.BatteryManager; 206 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in batteryStateChanged_withChargingSourceDock_isChargingSourceDockTrue() 207 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_DOCK); in batteryStateChanged_withChargingSourceDock_isChargingSourceDockTrue() 217 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_DISCHARGING); in batteryStateChanged_withChargingSourceNotDock_isChargingSourceDockFalse() 218 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_WIRELESS); in batteryStateChanged_withChargingSourceNotDock_isChargingSourceDockFalse() 228 intent.putExtra(BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_GOOD); in batteryStateChanged_healthNotOverheated_outputsFalse() 238 intent.putExtra(BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_OVERHEAT); in batteryStateChanged_healthOverheated_outputsTrue()
|
/frameworks/base/packages/SettingsProvider/src/android/provider/settings/validators/ |
D | GlobalSettingsValidators.java | 33 import android.os.BatteryManager; 54 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put() 55 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put() 56 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put() 57 || (val == BatteryManager.BATTERY_PLUGGED_DOCK) in VALIDATORS.put() 59 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 60 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put() 62 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 63 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() 65 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() [all …]
|
D | SystemSettingsValidators.java | 31 import android.os.BatteryManager; 51 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put() 52 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put() 53 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put() 55 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 56 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put() 58 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put() 59 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() 61 == (BatteryManager.BATTERY_PLUGGED_USB in VALIDATORS.put() 62 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put() [all …]
|
/frameworks/base/apex/jobscheduler/service/java/com/android/server/tare/ |
D | ChargingModifier.java | 24 import android.os.BatteryManager; 93 filter.addAction(BatteryManager.ACTION_CHARGING); in startTracking() 94 filter.addAction(BatteryManager.ACTION_DISCHARGING); in startTracking() 98 final BatteryManager batteryManager = context.getSystemService(BatteryManager.class); in startTracking() 116 if (BatteryManager.ACTION_CHARGING.equals(action)) { in onReceive() 125 } else if (BatteryManager.ACTION_DISCHARGING.equals(action)) { in onReceive()
|
/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 | 19 import static android.os.BatteryManager.BATTERY_HEALTH_OVERHEAT; 20 import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; 21 import static android.os.BatteryManager.EXTRA_HEALTH; 22 import static android.os.BatteryManager.EXTRA_PRESENT; 29 import android.os.BatteryManager; 214 * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0) in onReceive() 215 / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100)); in onReceive() 216 mPluggedChargingSource = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); in onReceive() 218 final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 219 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() [all …]
|
/frameworks/base/services/core/java/com/android/server/health/ |
D | HealthServiceWrapperAidl.java | 23 import android.os.BatteryManager; 118 case BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER: in getPropertyInternal() 121 case BatteryManager.BATTERY_PROPERTY_CURRENT_NOW: in getPropertyInternal() 124 case BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE: in getPropertyInternal() 127 case BatteryManager.BATTERY_PROPERTY_CAPACITY: in getPropertyInternal() 130 case BatteryManager.BATTERY_PROPERTY_STATUS: in getPropertyInternal() 133 case BatteryManager.BATTERY_PROPERTY_ENERGY_COUNTER: in getPropertyInternal()
|
D | HealthServiceWrapperHidl.java | 28 import android.os.BatteryManager; 77 case BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER: in getProperty() 84 case BatteryManager.BATTERY_PROPERTY_CURRENT_NOW: in getProperty() 91 case BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE: in getProperty() 98 case BatteryManager.BATTERY_PROPERTY_CAPACITY: in getProperty() 105 case BatteryManager.BATTERY_PROPERTY_STATUS: in getProperty() 112 case BatteryManager.BATTERY_PROPERTY_ENERGY_COUNTER: in getProperty()
|
/frameworks/base/services/core/java/com/android/server/powerstats/ |
D | BatteryTrigger.java | 23 import android.os.BatteryManager; 42 int newBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); 62 mBatteryLevel = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); in BatteryTrigger()
|
/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/ |
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; 108 @VisibleForTesting int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; 294 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive() 296 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 297 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 299 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive() 301 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive() 451 || snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN) { in shouldShowHybridWarning() 454 + (snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN)); in shouldShowHybridWarning() 508 && currentSnapshot.getBatteryStatus() != BatteryManager.BATTERY_STATUS_UNKNOWN; in shouldShowLowBatteryWarning()
|
/frameworks/base/core/java/android/os/ |
D | BatteryManager.java | 36 public class BatteryManager { class 264 public BatteryManager() { in BatteryManager() method in BatteryManager 273 public BatteryManager(Context context, in BatteryManager() method in BatteryManager
|
/frameworks/base/core/java/com/android/internal/os/ |
D | BatteryStatsHistoryIterator.java | 20 import android.os.BatteryManager; 119 cur.batteryPlugType = BatteryManager.BATTERY_PLUGGED_AC; in readHistoryDelta() 122 cur.batteryPlugType = BatteryManager.BATTERY_PLUGGED_USB; in readHistoryDelta() 125 cur.batteryPlugType = BatteryManager.BATTERY_PLUGGED_WIRELESS; in readHistoryDelta()
|
/frameworks/opt/telephony/src/java/com/android/internal/telephony/ |
D | DeviceStateMonitor.java | 36 import android.os.BatteryManager; 239 case BatteryManager.ACTION_CHARGING: 243 case BatteryManager.ACTION_DISCHARGING: 299 filter.addAction(BatteryManager.ACTION_CHARGING); in DeviceStateMonitor() 300 filter.addAction(BatteryManager.ACTION_DISCHARGING); in DeviceStateMonitor() 701 final BatteryManager bm = (BatteryManager) mPhone.getContext().getSystemService( in isDeviceCharging()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/power/ |
D | PowerUITest.java | 32 import android.os.BatteryManager; 400 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_lowLevelWarning() 404 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_lowLevelWarning() 459 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_severeLevelWarning() 463 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_severeLevelWarning() 536 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 546 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, 0, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 590 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowStandardWarning() 594 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowStandardWarning() 705 public int mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD;
|
/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()
|