/frameworks/base/services/core/java/com/android/server/ |
D | BatteryService.java | 36 import android.os.BatteryManager; 334 if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked() 337 if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 && mHealthInfo.chargerAcOnline) { in isPoweredLocked() 340 … if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 && mHealthInfo.chargerUsbOnline) { in isPoweredLocked() 343 …if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mHealthInfo.chargerWirelessOnl… in isPoweredLocked() 360 && mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked() 383 return mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING; in shouldShutdownLocked() 473 mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in processValuesLocked() 476 mPlugType = BatteryManager.BATTERY_PLUGGED_AC; in processValuesLocked() 478 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; 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 | 20 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; 96 @VisibleForTesting int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; 228 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive() 230 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 231 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 233 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive() 235 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive() 400 || snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN) { in shouldShowHybridWarning() 403 + (snapshot.getBatteryStatus() == BatteryManager.BATTERY_STATUS_UNKNOWN)); in shouldShowHybridWarning() 459 && 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/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/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/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/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/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/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 | 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; 66 import android.os.BatteryManager; [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/power/ |
D | PowerManagerServiceTest.java | 53 import android.os.BatteryManager; 266 when(mBatteryManagerInternalMock.isPowered(BatteryManager.BATTERY_PLUGGED_ANY)) in setPluggedIn() 410 .thenReturn(BatteryManager.BATTERY_PLUGGED_WIRELESS); in testWakefulnessAwake_ShouldWakeUpWhenPluggedIn() 412 BatteryManager.BATTERY_PLUGGED_WIRELESS)).thenReturn(false); in testWakefulnessAwake_ShouldWakeUpWhenPluggedIn()
|
/frameworks/base/core/java/android/provider/ |
D | Settings.java | 69 import android.os.BatteryManager; 3141 || (val == BatteryManager.BATTERY_PLUGGED_AC) 3142 || (val == BatteryManager.BATTERY_PLUGGED_USB) 3143 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) 3144 || (val == (BatteryManager.BATTERY_PLUGGED_AC 3145 | BatteryManager.BATTERY_PLUGGED_USB)) 3146 || (val == (BatteryManager.BATTERY_PLUGGED_AC 3147 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 3148 || (val == (BatteryManager.BATTERY_PLUGGED_USB 3149 | 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);
|