/frameworks/base/cmds/svc/src/com/android/commands/svc/ |
D | PowerCommand.java | 20 import android.os.BatteryManager; 68 val = BatteryManager.BATTERY_PLUGGED_AC | in run() 69 BatteryManager.BATTERY_PLUGGED_USB | in run() 70 BatteryManager.BATTERY_PLUGGED_WIRELESS; 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()
|
/frameworks/base/services/core/java/com/android/server/ |
D | BatteryService.java | 34 import android.os.BatteryManager; 329 if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked() 332 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 && mHealthInfo.chargerAcOnline) { in isPoweredLocked() 335 … if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 && mHealthInfo.chargerUsbOnline) { in isPoweredLocked() 338 …if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mHealthInfo.chargerWirelessOnl… in isPoweredLocked() 355 && mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked() 374 return mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING; in shouldShutdownLocked() 463 mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in processValuesLocked() 466 mPlugType = BatteryManager.BATTERY_PLUGGED_AC; in processValuesLocked() 468 mPlugType = BatteryManager.BATTERY_PLUGGED_USB; in processValuesLocked() [all …]
|
D | CachedDeviceStateService.java | 23 import android.os.BatteryManager; 46 intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/ |
D | BatteryControllerImpl.java | 23 import android.os.BatteryManager; 144 * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0) in onReceive() 145 / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100)); in onReceive() 146 mPluggedIn = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0; in onReceive() 148 final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 149 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 150 mCharged = status == BatteryManager.BATTERY_STATUS_FULL; in onReceive() 151 mCharging = mCharged || status == BatteryManager.BATTERY_STATUS_CHARGING; in onReceive() 175 dummy.putExtra("plugged", incr > 0 ? BatteryManager.BATTERY_PLUGGED_AC in onReceive()
|
/frameworks/base/services/core/java/com/android/server/job/controllers/ |
D | BatteryController.java | 25 import android.os.BatteryManager; 133 filter.addAction(BatteryManager.ACTION_CHARGING); in startTracking() 134 filter.addAction(BatteryManager.ACTION_DISCHARGING); in startTracking() 141 mCharging = batteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); in startTracking() 206 } else if (BatteryManager.ACTION_CHARGING.equals(action)) { in onReceiveInternal() 213 } else if (BatteryManager.ACTION_DISCHARGING.equals(action)) { in onReceiveInternal() 220 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/packages/SettingsLib/src/com/android/settingslib/ |
D | Utils.java | 22 import android.os.BatteryManager; 172 int level = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); in getBatteryLevel() 173 int scale = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 100); in getBatteryLevel() 178 int status = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus() 179 BatteryManager.BATTERY_STATUS_UNKNOWN); in getBatteryStatus() 181 if (status == BatteryManager.BATTERY_STATUS_CHARGING) { in getBatteryStatus() 183 } else if (status == BatteryManager.BATTERY_STATUS_DISCHARGING) { in getBatteryStatus() 185 } else if (status == BatteryManager.BATTERY_STATUS_NOT_CHARGING) { in getBatteryStatus() 187 } else if (status == BatteryManager.BATTERY_STATUS_FULL) { in getBatteryStatus()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/power/ |
D | PowerUI.java | 27 import android.os.BatteryManager; 94 @VisibleForTesting int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; 226 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive() 228 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 229 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 231 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive() 233 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive() 398 || snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN) { in shouldShowHybridWarning() 401 + (snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN)); in shouldShowHybridWarning() 457 && currentSnapshot.getBatteryStatus() != BatteryManager.BATTERY_STATUS_UNKNOWN; in shouldShowLowBatteryWarning()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
D | CachedDeviceStateServiceTest.java | 26 import android.os.BatteryManager; 129 intentPluggedIn.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_AC); in correctlyReportsCharging() 134 intentUnplugged.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_NONE); in correctlyReportsCharging() 164 intentPluggedIn.putExtra(BatteryManager.EXTRA_PLUGGED, OsProtoEnums.BATTERY_PLUGGED_AC); in correctlyTracksTimeOnBattery()
|
/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/opt/telephony/src/java/com/android/internal/telephony/ |
D | DeviceStateMonitor.java | 33 import android.os.BatteryManager; 214 case BatteryManager.ACTION_CHARGING: 218 case BatteryManager.ACTION_DISCHARGING: 264 filter.addAction(BatteryManager.ACTION_CHARGING); in DeviceStateMonitor() 265 filter.addAction(BatteryManager.ACTION_DISCHARGING); in DeviceStateMonitor() 632 final BatteryManager bm = (BatteryManager) mPhone.getContext().getSystemService( in isDeviceCharging()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/net/ |
D | ConnOnActivityStartTest.java | 28 import android.os.BatteryManager; 97 private static BatteryManager mBatteryManager; 115 mBatteryManager = (BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE); in setUpOnce() 326 executeCommand("cmd battery set status " + BatteryManager.BATTERY_STATUS_NOT_CHARGING); in turnBatteryOn() 339 executeCommand("cmd battery set ac " + BatteryManager.BATTERY_PLUGGED_AC); in turnBatteryOff() 340 executeCommand("cmd battery set status " + BatteryManager.BATTERY_STATUS_CHARGING); in turnBatteryOff()
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/ |
D | DeviceStateMonitorTest.java | 31 import android.os.BatteryManager; 108 Intent intent = new Intent(BatteryManager.ACTION_CHARGING); in testCharging() 116 intent = new Intent(BatteryManager.ACTION_DISCHARGING); in testCharging()
|
/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/packages/SystemUI/tests/src/com/android/systemui/power/ |
D | PowerUITest.java | 31 import android.os.BatteryManager; 379 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_lowLevelWarning() 383 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_lowLevelWarning() 444 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowHybridWarning_severeLevelWarning() 448 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowHybridWarning_severeLevelWarning() 521 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 531 BATTERY_LEVEL_10, false, false, 0, BatteryManager.BATTERY_HEALTH_GOOD, 0, in testRefreshEstimateIfNeeded_onlyQueriesEstimateOnBatteryLevelChangeOrNull() 575 state.mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; in testShouldShowStandardWarning() 579 state.mBatteryStatus = BatteryManager.BATTERY_HEALTH_GOOD; in testShouldShowStandardWarning() 689 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/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/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/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/base/services/core/java/com/android/server/pm/ |
D | BackgroundDexOptService.java | 31 import android.os.BatteryManager; 152 int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); in getBatteryLevel() 153 int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); in getBatteryLevel() 154 boolean present = intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, true); in getBatteryLevel()
|
/frameworks/base/packages/SystemUI/src/com/android/keyguard/ |
D | KeyguardUpdateMonitor.java | 22 import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; 23 import static android.os.BatteryManager.BATTERY_STATUS_FULL; 24 import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; 25 import static android.os.BatteryManager.EXTRA_HEALTH; 26 import static android.os.BatteryManager.EXTRA_LEVEL; 27 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT; 28 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE; 29 import static android.os.BatteryManager.EXTRA_PLUGGED; 30 import static android.os.BatteryManager.EXTRA_STATUS; 59 import android.os.BatteryManager; [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/power/ |
D | PowerManagerServiceTest.java | 50 import android.os.BatteryManager; 257 when(mBatteryManagerInternalMock.isPowered(BatteryManager.BATTERY_PLUGGED_ANY)) in setPluggedIn() 392 .thenReturn(BatteryManager.BATTERY_PLUGGED_WIRELESS); in testWakefulnessAwake_ShouldWakeUpWhenPluggedIn() 394 BatteryManager.BATTERY_PLUGGED_WIRELESS)).thenReturn(false); in testWakefulnessAwake_ShouldWakeUpWhenPluggedIn()
|
/frameworks/base/core/java/android/provider/ |
D | Settings.java | 69 import android.os.BatteryManager; 3110 || (val == BatteryManager.BATTERY_PLUGGED_AC) 3111 || (val == BatteryManager.BATTERY_PLUGGED_USB) 3112 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) 3113 || (val == (BatteryManager.BATTERY_PLUGGED_AC 3114 | BatteryManager.BATTERY_PLUGGED_USB)) 3115 || (val == (BatteryManager.BATTERY_PLUGGED_AC 3116 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 3117 || (val == (BatteryManager.BATTERY_PLUGGED_USB 3118 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) [all …]
|
/frameworks/base/services/core/java/com/android/server/power/batterysaver/ |
D | BatterySaverController.java | 25 import android.os.BatteryManager; 182 mIsPluggedIn = (intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0);
|