Home
last modified time | relevance | path

Searched refs:BatteryManager (Results 1 – 25 of 89) sorted by relevance

1234

/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DBatteryStatsResetTest.java25 import android.os.BatteryManager;
102 mBatteryStatus = BatteryManager.BATTERY_STATUS_FULL; in setUp()
103 mBatteryHealth = BatteryManager.BATTERY_HEALTH_GOOD; in setUp()
104 mBatteryPlugType = BatteryManager.BATTERY_PLUGGED_USB; in setUp()
122 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_highBatteryLevel()
128 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_highBatteryLevel()
143 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_highBatteryLevel()
159 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_significantCharge()
165 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_significantCharge()
174 plugBattery(BatteryManager.BATTERY_PLUGGED_USB); in testResetOnUnplug_significantCharge()
[all …]
DBatteryChargeCalculatorTest.java24 import android.os.BatteryManager;
64 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
67 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
70 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
93 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_CHARGING, 100, in testDischargeTotals()
94 BatteryManager.BATTERY_PLUGGED_USB, 80, 72, 3700, 2_400_000, 4_000_000, 100, in testDischargeTotals()
107 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable()
110 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable()
113 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable()
DBatteryStatsHistoryIteratorTest.java21 import android.os.BatteryManager;
142 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in prepareHistory()
145 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in prepareHistory()
169 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in tagsLongHistory()
233 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in cpuSuspendHistoryEvents()
240 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in cpuSuspendHistoryEvents()
252 mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, in cpuSuspendHistoryEvents()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/fuelgauge/
DBatteryStatus.java19 import static android.os.BatteryManager.BATTERY_STATUS_FULL;
20 import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN;
21 import static android.os.BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE;
22 import static android.os.BatteryManager.CHARGING_POLICY_DEFAULT;
23 import static android.os.BatteryManager.EXTRA_CHARGING_STATUS;
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_PRESENT;
28 import static android.os.BatteryManager.EXTRA_STATUS;
[all …]
/frameworks/base/core/java/android/hardware/
DBatteryState.java21 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/cmds/svc/src/com/android/commands/svc/
DPowerCommand.java20 import android.os.BatteryManager;
67 val = BatteryManager.BATTERY_PLUGGED_AC in run()
68 | BatteryManager.BATTERY_PLUGGED_USB in run()
69 | BatteryManager.BATTERY_PLUGGED_WIRELESS in run()
70 | BatteryManager.BATTERY_PLUGGED_DOCK; in run()
75 val = BatteryManager.BATTERY_PLUGGED_USB; in run()
77 val = BatteryManager.BATTERY_PLUGGED_AC; in run()
79 val = BatteryManager.BATTERY_PLUGGED_WIRELESS; in run()
81 val = BatteryManager.BATTERY_PLUGGED_DOCK; in run()
/frameworks/base/packages/SettingsLib/tests/unit/src/com/android/settingslib/fuelgague/
DBatteryStatusTest.kt21 import android.os.BatteryManager
22 import android.os.BatteryManager.BATTERY_PLUGGED_AC
23 import android.os.BatteryManager.BATTERY_PLUGGED_DOCK
24 import android.os.BatteryManager.BATTERY_PLUGGED_USB
25 import android.os.BatteryManager.BATTERY_PLUGGED_WIRELESS
26 import android.os.BatteryManager.BATTERY_STATUS_FULL
27 import android.os.BatteryManager.BATTERY_STATUS_UNKNOWN
28 import android.os.BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE
29 import android.os.BatteryManager.CHARGING_POLICY_DEFAULT
30 import android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT
[all …]
/frameworks/base/services/core/java/com/android/server/
DBatteryService.java37 import android.os.BatteryManager;
366 if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked()
369 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 in isPoweredLocked()
373 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 in isPoweredLocked()
377 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 in isPoweredLocked()
381 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_DOCK) != 0 in isPoweredLocked()
399 && mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked()
425 return mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING; in shouldShutdownLocked()
493 return BatteryManager.BATTERY_PLUGGED_AC; in plugType()
495 return BatteryManager.BATTERY_PLUGGED_USB; in plugType()
[all …]
DCachedDeviceStateService.java23 import android.os.BatteryManager;
46 intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,
/frameworks/base/services/core/java/com/android/server/health/
DHealthServiceWrapperAidl.java26 import android.os.BatteryManager;
122 case BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER: in getPropertyInternal()
125 case BatteryManager.BATTERY_PROPERTY_CURRENT_NOW: in getPropertyInternal()
128 case BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE: in getPropertyInternal()
131 case BatteryManager.BATTERY_PROPERTY_CAPACITY: in getPropertyInternal()
134 case BatteryManager.BATTERY_PROPERTY_STATUS: in getPropertyInternal()
137 case BatteryManager.BATTERY_PROPERTY_ENERGY_COUNTER: in getPropertyInternal()
140 case BatteryManager.BATTERY_PROPERTY_MANUFACTURING_DATE: in getPropertyInternal()
144 case BatteryManager.BATTERY_PROPERTY_FIRST_USAGE_DATE: in getPropertyInternal()
148 case BatteryManager.BATTERY_PROPERTY_CHARGING_POLICY: in getPropertyInternal()
[all …]
DHealthServiceWrapperHidl.java28 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/packages/SettingsLib/tests/robotests/src/com/android/settingslib/
DUtilsTest.java37 import android.os.BatteryManager;
345 .putExtra(BatteryManager.EXTRA_LEVEL, 100) in getBatteryStatus_statusIsFull_returnFullString()
346 .putExtra(BatteryManager.EXTRA_SCALE, 100); in getBatteryStatus_statusIsFull_returnFullString()
357 .putExtra(BatteryManager.EXTRA_LEVEL, 100) in getBatteryStatus_statusIsFullAndUseCompactStatus_returnFullyChargedString()
358 .putExtra(BatteryManager.EXTRA_SCALE, 100); in getBatteryStatus_statusIsFullAndUseCompactStatus_returnFullyChargedString()
369 .putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_FULL); in getBatteryStatus_batteryLevelIs100_returnFullString()
380 .putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_FULL); in getBatteryStatus_batteryLevelIs100AndUseCompactStatus_returnFullyString()
390 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in getBatteryStatus_batteryLevel99_returnChargingString()
391 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_USB); in getBatteryStatus_batteryLevel99_returnChargingString()
401 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in getBatteryStatus_chargingDock_returnDockChargingString()
[all …]
/frameworks/base/packages/SettingsProvider/src/android/provider/settings/validators/
DSystemSettingsValidators.java38 import android.os.BatteryManager;
58 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put()
59 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put()
60 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put()
61 || (val == BatteryManager.BATTERY_PLUGGED_DOCK) in VALIDATORS.put()
63 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put()
64 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put()
66 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put()
67 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put()
69 == (BatteryManager.BATTERY_PLUGGED_USB in VALIDATORS.put()
[all …]
DGlobalSettingsValidators.java41 import android.os.BatteryManager;
65 || (val == BatteryManager.BATTERY_PLUGGED_AC) in VALIDATORS.put()
66 || (val == BatteryManager.BATTERY_PLUGGED_USB) in VALIDATORS.put()
67 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) in VALIDATORS.put()
68 || (val == BatteryManager.BATTERY_PLUGGED_DOCK) in VALIDATORS.put()
70 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put()
71 | BatteryManager.BATTERY_PLUGGED_USB)) in VALIDATORS.put()
73 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put()
74 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) in VALIDATORS.put()
76 == (BatteryManager.BATTERY_PLUGGED_AC in VALIDATORS.put()
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/
DBatteryControllerTest.java19 import static android.os.BatteryManager.EXTRA_PRESENT;
35 import android.os.BatteryManager;
220 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in batteryStateChanged_withChargingSourceDock_isChargingSourceDockTrue()
221 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_DOCK); in batteryStateChanged_withChargingSourceDock_isChargingSourceDockTrue()
231 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_DISCHARGING); in batteryStateChanged_withChargingSourceNotDock_isChargingSourceDockFalse()
232 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_WIRELESS); in batteryStateChanged_withChargingSourceNotDock_isChargingSourceDockFalse()
242 intent.putExtra(BatteryManager.EXTRA_CHARGING_STATUS, in batteryStateChanged_chargingStatusNotLongLife_outputsFalse()
243 BatteryManager.CHARGING_POLICY_DEFAULT); in batteryStateChanged_chargingStatusNotLongLife_outputsFalse()
253 intent.putExtra(BatteryManager.EXTRA_CHARGING_STATUS, in batteryStateChanged_chargingStatusLongLife_outputsTrue()
254 BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE); in batteryStateChanged_chargingStatusLongLife_outputsTrue()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/
DBatteryControllerImpl.java19 import static android.os.BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE;
20 import static android.os.BatteryManager.CHARGING_POLICY_DEFAULT;
21 import static android.os.BatteryManager.EXTRA_CHARGING_STATUS;
22 import static android.os.BatteryManager.EXTRA_PRESENT;
34 import android.os.BatteryManager;
251 * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0) in onReceive()
252 / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100)); in onReceive()
253 mPluggedChargingSource = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); in onReceive()
255 final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive()
256 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive()
[all …]
DBatteryControllerLogger.kt20 import android.os.BatteryManager.EXTRA_LEVEL
21 import android.os.BatteryManager.EXTRA_SCALE
/frameworks/opt/telephony/src/java/com/android/internal/telephony/satellite/metrics/
DControllerMetricsStats.java24 import android.os.BatteryManager;
351 BatteryManager batteryManager = mContext.getSystemService(BatteryManager.class); in startCaptureBatteryLevel()
353 batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY); in startCaptureBatteryLevel()
364 BatteryManager batteryManager = context.getSystemService(BatteryManager.class); in captureTotalBatteryConsumptionPercent()
366 batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY); in captureTotalBatteryConsumptionPercent()
384 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
385 boolean isCharged = (status == BatteryManager.BATTERY_STATUS_CHARGING);
/frameworks/base/services/core/java/com/android/server/powerstats/
DBatteryTrigger.java23 import android.os.BatteryManager;
42 int newBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
63 mBatteryLevel = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); in BatteryTrigger()
/frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/
DUpdateInstaller.java26 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/
DCachedDeviceStateServiceTest.java26 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/
DPowerUI.java27 import android.os.BatteryManager;
111 @VisibleForTesting int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN;
319 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive()
321 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive()
322 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive()
324 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive()
326 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive()
476 || snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN) { in shouldShowHybridWarning()
479 + (snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN)); in shouldShowHybridWarning()
533 && currentSnapshot.getBatteryStatus() != BatteryManager.BATTERY_STATUS_UNKNOWN; in shouldShowLowBatteryWarning()
/frameworks/base/services/core/java/com/android/server/pm/dex/
DDexManager.java32 import android.os.BatteryManager;
102 private BatteryManager mBatteryManager = null;
665 private BatteryManager getBatteryManager() { in getBatteryManager()
667 mBatteryManager = mContext.getSystemService(BatteryManager.class); in getBatteryManager()
678 BatteryManager batteryManager = getBatteryManager(); in areBatteryThermalOrMemoryCritical()
680 && batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_STATUS) in areBatteryThermalOrMemoryCritical()
681 == BatteryManager.BATTERY_STATUS_DISCHARGING in areBatteryThermalOrMemoryCritical()
682 && batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) in areBatteryThermalOrMemoryCritical()
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DBatteryInputSuspendTest.java25 import android.os.BatteryManager;
112 return batteryMonitor.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0; in isCharging()
/frameworks/base/services/core/java/com/android/server/storage/
DDiskStatsLoggingService.java28 import android.os.BatteryManager;
109 BatteryManager batteryManager = in isCharging()
110 (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE); in isCharging()

1234