Home
last modified time | relevance | path

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

123

/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/
DBatteryBroadcastReceiverTest.java35 import android.os.BatteryManager;
70 mBatteryBroadcastReceiver.mBatteryHealth = BatteryManager.BATTERY_HEALTH_UNKNOWN; in setUp()
71 mBatteryBroadcastReceiver.mChargingStatus = BatteryManager.CHARGING_POLICY_DEFAULT; in setUp()
75 mChargingIntent.putExtra(BatteryManager.EXTRA_LEVEL, BATTERY_INTENT_LEVEL); in setUp()
76 mChargingIntent.putExtra(BatteryManager.EXTRA_SCALE, BATTERY_INTENT_SCALE); in setUp()
78 BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING); in setUp()
97 BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_OVERHEAT); in onReceive_batteryHealthChanged_dataUpdated()
101 .isEqualTo(BatteryManager.BATTERY_HEALTH_OVERHEAT); in onReceive_batteryHealthChanged_dataUpdated()
108 BatteryManager.EXTRA_CHARGING_STATUS, in onReceive_chargingStatusChanged_dataUpdated()
109 BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE); in onReceive_chargingStatusChanged_dataUpdated()
[all …]
DBatteryInfoTest.java38 import android.os.BatteryManager;
94 ChargingType.WIRED, BatteryManager.BATTERY_PLUGGED_AC,
95 ChargingType.WIRELESS, BatteryManager.BATTERY_PLUGGED_WIRELESS,
96 ChargingType.DOCKED, BatteryManager.BATTERY_PLUGGED_DOCK);
294 mChargingBatteryBroadcast.putExtra(BatteryManager.EXTRA_LEVEL, 100); in getBatteryInfo_pluggedInWithFullBattery_onlyShowBatteryLevel()
315 BatteryManager.EXTRA_CHARGING_STATUS, in getBatteryInfo_chargingWithDefender_updateChargeLabel()
316 BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE); in getBatteryInfo_chargingWithDefender_updateChargeLabel()
375 BatteryManager.BATTERY_PLUGGED_DOCK, in getBatteryInfo_dockDefenderActive_updateChargeString()
377 BatteryManager.BATTERY_STATUS_CHARGING) in getBatteryInfo_dockDefenderActive_updateChargeString()
379 BatteryManager.EXTRA_CHARGING_STATUS, in getBatteryInfo_dockDefenderActive_updateChargeString()
[all …]
DBatterySaverReceiverTest.java22 import android.os.BatteryManager;
50 intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_AC); in testOnReceive_devicePluggedIn_pluggedInTrue()
60 intent.putExtra(BatteryManager.EXTRA_PLUGGED, 0); in testOnReceive_deviceNotPluggedIn_pluggedInFalse()
DBatteryHeaderPreferenceControllerTest.java33 import android.os.BatteryManager;
97 mBatteryIntent.putExtra(BatteryManager.EXTRA_LEVEL, BATTERY_LEVEL); in setUp()
98 mBatteryIntent.putExtra(BatteryManager.EXTRA_SCALE, 100); in setUp()
99 mBatteryIntent.putExtra(BatteryManager.EXTRA_PLUGGED, 1); in setUp()
166 mBatteryInfo.batteryStatus = BatteryManager.BATTERY_STATUS_NOT_CHARGING; in updatePreference_statusAnomalous_showStatusLabel()
289 batteryInfo.pluggedStatus = BatteryManager.BATTERY_PLUGGED_WIRELESS; in updateBatteryStatus_customizedWirelessChargingLabel_customizedLabel()
312 batteryInfo.pluggedStatus = BatteryManager.BATTERY_PLUGGED_WIRELESS; in updateBatteryStatus_noCustomizedWirelessChargingLabel_statusWithRemainingLabel()
331 batteryInfo.pluggedStatus = BatteryManager.BATTERY_PLUGGED_WIRELESS; in updateBatteryStatus_noCustomizedWirelessChargingLabel_v1StatusWithRemainingLabel()
/packages/apps/Settings/tests/unit/src/com/android/settings/testutils/
DBatteryTestUtils.java20 import android.os.BatteryManager;
26 BatteryManager.BATTERY_PLUGGED_AC, in getChargingIntent()
29 BatteryManager.BATTERY_STATUS_CHARGING); in getChargingIntent()
37 BatteryManager.BATTERY_STATUS_DISCHARGING); in getDischargingIntent()
42 intent.putExtra(BatteryManager.EXTRA_PLUGGED, plugged); in getCustomBatteryIntent()
43 intent.putExtra(BatteryManager.EXTRA_LEVEL, level); in getCustomBatteryIntent()
44 intent.putExtra(BatteryManager.EXTRA_SCALE, scale); in getCustomBatteryIntent()
45 intent.putExtra(BatteryManager.EXTRA_STATUS, status); in getCustomBatteryIntent()
/packages/modules/OnDevicePersonalization/tests/federatedcomputetests/src/com/android/federatedcompute/services/common/
DBatteryInfoTest.java27 import android.os.BatteryManager;
53 intent.putExtra(BatteryManager.EXTRA_LEVEL, 60); in batteryOkForTraining_returnOk()
54 intent.putExtra(BatteryManager.EXTRA_SCALE, 100); in batteryOkForTraining_returnOk()
63 intent.putExtra(BatteryManager.EXTRA_LEVEL, 10); in batteryOkForTraining_batteryLevelTooLow_returnNotOk()
64 intent.putExtra(BatteryManager.EXTRA_SCALE, 100); in batteryOkForTraining_batteryLevelTooLow_returnNotOk()
73 intent.putExtra(BatteryManager.EXTRA_LEVEL, 10); in batteryOkForTraining_disableBatteryLevelNotLowCheck_returnOk()
74 intent.putExtra(BatteryManager.EXTRA_SCALE, 100); in batteryOkForTraining_disableBatteryLevelNotLowCheck_returnOk()
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/
DBatteryUsageBroadcastReceiverTest.java29 import android.os.BatteryManager;
86 doReturn(getBatteryIntent(/* level= */ 20, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_aospNotFullCharged_notFetchUsageData()
104 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_FULL)) in onReceive_aospNearBooting_notFetchUsageData()
125 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_aospWrongAction_notFetchUsageData()
145 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_aospNormal_fetchUsageData()
164 doReturn(getBatteryIntent(/* level= */ 20, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_pixelNotFullCharged_notFetchUsageData()
182 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_FULL)) in onReceive_pixelNearBooting_fetchUsageData()
203 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_pixelWrongAction_notFetchUsageData()
223 doReturn(getBatteryIntent(/* level= */ 100, BatteryManager.BATTERY_STATUS_UNKNOWN)) in onReceive_pixelNormal_fetchUsageData()
270 intent.putExtra(BatteryManager.EXTRA_LEVEL, level); in getBatteryIntent()
[all …]
DBatteryHistEntryTest.java28 import android.os.BatteryManager;
78 /* batteryStatus= */ BatteryManager.BATTERY_STATUS_FULL, in testConstructor_contentValues_returnsExpectedResult()
79 /* batteryHealth= */ BatteryManager.BATTERY_HEALTH_COLD, in testConstructor_contentValues_returnsExpectedResult()
371 assertThat(entry.mBatteryStatus).isEqualTo(BatteryManager.BATTERY_STATUS_FULL); in assertBatteryHistEntry()
372 assertThat(entry.mBatteryHealth).isEqualTo(BatteryManager.BATTERY_HEALTH_COLD); in assertBatteryHistEntry()
401 .setBatteryStatus(BatteryManager.BATTERY_STATUS_FULL) in createBatteryHistEntry()
402 .setBatteryHealth(BatteryManager.BATTERY_HEALTH_COLD) in createBatteryHistEntry()
DDatabaseUtilsTest.java42 import android.os.BatteryManager;
568 .isEqualTo(BatteryManager.BATTERY_STATUS_FULL); in verifyBatteryEntryContentValues()
570 .isEqualTo(BatteryManager.BATTERY_HEALTH_COLD); in verifyBatteryEntryContentValues()
580 .isEqualTo(BatteryManager.BATTERY_STATUS_FULL); in verifyFakeBatteryEntryContentValues()
582 .isEqualTo(BatteryManager.BATTERY_HEALTH_COLD); in verifyFakeBatteryEntryContentValues()
588 intent.putExtra(BatteryManager.EXTRA_LEVEL, 20); in getBatteryIntent()
589 intent.putExtra(BatteryManager.EXTRA_SCALE, 100); in getBatteryIntent()
590 intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_FULL); in getBatteryIntent()
591 intent.putExtra(BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_COLD); in getBatteryIntent()
DConvertUtilsTest.java36 import android.os.BatteryManager;
105 /* batteryStatus= */ BatteryManager.BATTERY_STATUS_FULL, in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
106 /* batteryHealth= */ BatteryManager.BATTERY_HEALTH_COLD, in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
141 .isEqualTo(BatteryManager.BATTERY_STATUS_FULL); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
143 .isEqualTo(BatteryManager.BATTERY_HEALTH_COLD); in convertBatteryEntryToContentValues_appEntry_returnsExpectedContentValues()
171 /* batteryStatus= */ BatteryManager.BATTERY_STATUS_FULL, in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
172 /* batteryHealth= */ BatteryManager.BATTERY_HEALTH_COLD, in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
207 .isEqualTo(BatteryManager.BATTERY_STATUS_FULL); in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
209 .isEqualTo(BatteryManager.BATTERY_HEALTH_COLD); in convertBatteryEntryToContentValues_systemEntry_returnsExpectedContentValues()
219 /* batteryStatus= */ BatteryManager.BATTERY_STATUS_FULL, in convertBatteryEntryToContentValues_nullBatteryEntry_returnsExpectedContentValues()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/testutils/
DBatteryTestUtils.java27 import android.os.BatteryManager;
61 BatteryManager.BATTERY_PLUGGED_AC, in getChargingIntent()
64 BatteryManager.BATTERY_STATUS_CHARGING); in getChargingIntent()
72 BatteryManager.BATTERY_STATUS_DISCHARGING); in getDischargingIntent()
190 intent.putExtra(BatteryManager.EXTRA_PLUGGED, plugged); in getCustomBatteryIntent()
191 intent.putExtra(BatteryManager.EXTRA_LEVEL, level); in getCustomBatteryIntent()
192 intent.putExtra(BatteryManager.EXTRA_SCALE, scale); in getCustomBatteryIntent()
193 intent.putExtra(BatteryManager.EXTRA_STATUS, status); in getCustomBatteryIntent()
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/common/
DBatteryInfo.java22 import android.os.BatteryManager;
39 int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); in handleBatteryStatusIntent()
40 int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1); in handleBatteryStatusIntent()
59 int status = stickyIntent.getIntExtra(BatteryManager.EXTRA_STATUS, 0); in batteryOkForTraining()
/packages/apps/Settings/src/com/android/settings/deviceinfo/batteryinfo/
DBatteryManufactureDatePreferenceController.java20 import android.os.BatteryManager;
35 private final BatteryManager mBatteryManager;
43 mBatteryManager = mContext.getSystemService(BatteryManager.class); in BatteryManufactureDatePreferenceController()
63 BatteryManager.BATTERY_PROPERTY_MANUFACTURING_DATE); in getManufactureDate()
DBatteryFirstUseDatePreferenceController.java20 import android.os.BatteryManager;
35 private final BatteryManager mBatteryManager;
43 mBatteryManager = mContext.getSystemService(BatteryManager.class); in BatteryFirstUseDatePreferenceController()
62 BatteryManager.BATTERY_PROPERTY_FIRST_USAGE_DATE); in getFirstUseDate()
DBatteryCycleCountPreferenceController.java21 import android.os.BatteryManager;
45 final int cycleCount = batteryIntent.getIntExtra(BatteryManager.EXTRA_CYCLE_COUNT, -1); in getSummary()
/packages/apps/Settings/src/com/android/settings/development/
DStayAwakePreferenceController.java23 import android.os.BatteryManager;
52 BatteryManager.BATTERY_PLUGGED_AC | BatteryManager.BATTERY_PLUGGED_USB
53 | BatteryManager.BATTERY_PLUGGED_WIRELESS | BatteryManager.BATTERY_PLUGGED_DOCK;
/packages/apps/Settings/src/com/android/settings/fuelgauge/
DBatteryInfo.java22 import android.os.BatteryManager;
237 batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) == 0; in getBatteryInfo()
306 info.pluggedStatus = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); in getBatteryInfo()
311 BatteryManager.EXTRA_CHARGING_STATUS, in getBatteryInfo()
312 BatteryManager.CHARGING_POLICY_DEFAULT) in getBatteryInfo()
313 == BatteryManager.CHARGING_POLICY_ADAPTIVE_LONGLIFE; in getBatteryInfo()
318 BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_UNKNOWN); in getBatteryInfo()
381 BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_UNKNOWN); in updateBatteryInfoCharging()
386 && status != BatteryManager.BATTERY_STATUS_FULL in updateBatteryInfoCharging()
421 && status != BatteryManager.BATTERY_STATUS_FULL in updateBatteryInfoCharging()
[all …]
DBatteryBroadcastReceiver.java24 import android.os.BatteryManager;
124 BatteryManager.EXTRA_CHARGING_STATUS, in updateBatteryStatus()
125 BatteryManager.CHARGING_POLICY_DEFAULT); in updateBatteryStatus()
128 BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_UNKNOWN); in updateBatteryStatus()
DBatteryHeaderPreferenceController.java20 import android.os.BatteryManager;
93 || info.batteryStatus == BatteryManager.BATTERY_STATUS_NOT_CHARGING) { in generateLabel()
96 if (info.pluggedStatus == BatteryManager.BATTERY_PLUGGED_WIRELESS) { in generateLabel()
157 batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) == 0; in quickUpdateHeaderPreference()
/packages/apps/Settings/tests/robotests/src/com/android/settings/deviceinfo/batteryinfo/
DBatteryFirstUseDatePreferenceControllerTest.java30 import android.os.BatteryManager;
49 private BatteryManager mBatteryManager;
56 mBatteryManager = mContext.getSystemService(BatteryManager.class); in setUp()
84 mShadowBatteryManager.setLongProperty(BatteryManager.BATTERY_PROPERTY_FIRST_USAGE_DATE, in getSummary_available_returnExpectedDate()
DBatteryManufactureDatePreferenceControllerTest.java30 import android.os.BatteryManager;
50 private BatteryManager mBatteryManager;
57 mBatteryManager = mContext.getSystemService(BatteryManager.class); in setUp()
85 mShadowBatteryManager.setLongProperty(BatteryManager.BATTERY_PROPERTY_MANUFACTURING_DATE, in getSummary_available_returnExpectedDate()
/packages/modules/Bluetooth/system/gd/rust/linux/stack/src/
Dbattery_manager.rs61 pub struct BatteryManager { struct
66 impl BatteryManager { implementation
71 ) -> BatteryManager { in new() argument
89 impl IBatteryManager for BatteryManager { implementation
/packages/apps/StorageManager/src/com/android/storagemanager/automatic/
DJobPreconditions.java7 import android.os.BatteryManager;
43 BatteryManager batteryManager = (BatteryManager) context.getSystemService( in isCharging()
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/db/
DBatteryStateTest.java21 import android.os.BatteryManager;
36 private static final int BATTERY_STATUS = BatteryManager.BATTERY_STATUS_FULL;
37 private static final int BATTERY_HEALTH = BatteryManager.BATTERY_HEALTH_COLD;
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/slices/
DDarkThemeSlice.java29 import android.os.BatteryManager;
168 final BatteryManager batteryManager = context.getSystemService(BatteryManager.class); in isAvailable()
169 final int level = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY); in isAvailable()

123