/frameworks/base/docs/html-intl/intl/ru/training/monitoring-device-state/ |
D | battery-monitoring.jd | 39 <p>Начните с определения текущего состояния зарядки. {@link android.os.BatteryManager} передает все… 49 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 50 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 51 status == BatteryManager.BATTERY_STATUS_FULL; 54 int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 65 <p>{@link android.os.BatteryManager} передает действие каждый раз, когда устройство подключается к … 79 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 80 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 81 status == BatteryManager.BATTERY_STATUS_FULL; 83 int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); [all …]
|
/frameworks/base/docs/html-intl/intl/ja/training/monitoring-device-state/ |
D | battery-monitoring.jd | 39 <p>初めに、現在の充電状態を特定します。{@link android.os.BatteryManager} によって電池と充電状態に関するすべての詳細情報が sticky {@link andro… 49 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 50 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 51 status == BatteryManager.BATTERY_STATUS_FULL; 54 int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 65 <p>{@link android.os.BatteryManager} は、端末が電源に接続されたときや接続が解除されたときに、アクションをブロードキャストします。このようなイベントは、アプリが実… 79 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 80 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 81 status == BatteryManager.BATTERY_STATUS_FULL; 83 int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); [all …]
|
/frameworks/base/docs/html-intl/intl/zh-cn/training/monitoring-device-state/ |
D | battery-monitoring.jd | 39 <p>请先确定当前的充电状态。{@link android.os.BatteryManager} 会通过一个包含充电状态的持续 {@link android.content.Intent} 广播所有… 49 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 50 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 51 status == BatteryManager.BATTERY_STATUS_FULL; 54 int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 65 <p>只要设备连接或断开电源,{@link android.os.BatteryManager} 就会广播相应的操作。即使您的应用没有运行,也请务必接收这些事件,尤其是当这些事件会影响您启动应用以执… 79 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 80 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 81 status == BatteryManager.BATTERY_STATUS_FULL; 83 int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); [all …]
|
/frameworks/base/docs/html-intl/intl/ko/training/monitoring-device-state/ |
D | battery-monitoring.jd | 39 <p>먼저 현재 충전 상태를 확인하는 것부터 시작합니다. {@link android.os.BatteryManager}는 배터리 충전 상태 등 충전 정보를 스티키 {@link an… 49 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 50 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 51 status == BatteryManager.BATTERY_STATUS_FULL; 54 int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 65 <p>{@link android.os.BatteryManager}는 기기가 전원에 연결되어 있는지 여부와 관계없이 언제나 액션을 브로드캐스트합니다. 앱이 실행되지 않는 동안에도 … 79 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 80 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 81 status == BatteryManager.BATTERY_STATUS_FULL; 83 int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); [all …]
|
/frameworks/base/cmds/svc/src/com/android/commands/svc/ |
D | PowerCommand.java | 20 import android.os.BatteryManager; 54 val = BatteryManager.BATTERY_PLUGGED_AC | in run() 55 BatteryManager.BATTERY_PLUGGED_USB | in run() 56 BatteryManager.BATTERY_PLUGGED_WIRELESS; in run() 61 val = BatteryManager.BATTERY_PLUGGED_USB; in run() 63 val = BatteryManager.BATTERY_PLUGGED_AC; in run() 65 val = BatteryManager.BATTERY_PLUGGED_WIRELESS; in run()
|
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/ |
D | Utils.java | 15 import android.os.BatteryManager; 114 int level = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); in getBatteryLevel() 115 int scale = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 100); in getBatteryLevel() 125 int plugType = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); in getBatteryStatus() 126 int status = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_STATUS, in getBatteryStatus() 127 BatteryManager.BATTERY_STATUS_UNKNOWN); in getBatteryStatus() 129 if (status == BatteryManager.BATTERY_STATUS_CHARGING) { in getBatteryStatus() 131 if (plugType == BatteryManager.BATTERY_PLUGGED_AC) { in getBatteryStatus() 134 } else if (plugType == BatteryManager.BATTERY_PLUGGED_USB) { in getBatteryStatus() 137 } else if (plugType == BatteryManager.BATTERY_PLUGGED_WIRELESS) { in getBatteryStatus() [all …]
|
D | BatteryInfo.java | 22 import android.os.BatteryManager; 136 info.mCharging = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0; in getBatteryInfo() 160 final int status = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_STATUS, in getBatteryInfo() 161 BatteryManager.BATTERY_STATUS_UNKNOWN); in getBatteryInfo() 162 if (chargeTime > 0 && status != BatteryManager.BATTERY_STATUS_FULL) { in getBatteryInfo() 167 int plugType = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); in getBatteryInfo() 169 if (plugType == BatteryManager.BATTERY_PLUGGED_AC) { in getBatteryInfo() 172 } else if (plugType == BatteryManager.BATTERY_PLUGGED_USB) { in getBatteryInfo() 175 } else if (plugType == BatteryManager.BATTERY_PLUGGED_WIRELESS) { in getBatteryInfo()
|
/frameworks/base/services/core/java/com/android/server/ |
D | BatteryService.java | 34 import android.os.BatteryManager; 243 if (mBatteryProps.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { in isPoweredLocked() 246 … if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 && mBatteryProps.chargerAcOnline) { in isPoweredLocked() 249 … if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 && mBatteryProps.chargerUsbOnline) { in isPoweredLocked() 252 …if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mBatteryProps.chargerWirelessO… in isPoweredLocked() 269 && mBatteryProps.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in shouldSendBatteryLowLocked() 277 … if (mBatteryProps.batteryLevel == 0 && !isPoweredLocked(BatteryManager.BATTERY_PLUGGED_ANY)) { in shutdownIfNoPowerLocked() 329 mPlugType = BatteryManager.BATTERY_PLUGGED_AC; in processValuesLocked() 331 mPlugType = BatteryManager.BATTERY_PLUGGED_USB; in processValuesLocked() 333 mPlugType = BatteryManager.BATTERY_PLUGGED_WIRELESS; in processValuesLocked() [all …]
|
D | UiModeManagerService.java | 35 import android.os.BatteryManager; 147 mCharging = (intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0);
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/ |
D | BatteryControllerImpl.java | 23 import android.os.BatteryManager; 108 * intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0) in onReceive() 109 / intent.getIntExtra(BatteryManager.EXTRA_SCALE, 100)); in onReceive() 110 mPluggedIn = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0; in onReceive() 112 final int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 113 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 114 mCharged = status == BatteryManager.BATTERY_STATUS_FULL; in onReceive() 115 mCharging = mCharged || status == BatteryManager.BATTERY_STATUS_CHARGING; in onReceive() 139 dummy.putExtra("plugged", incr > 0 ? BatteryManager.BATTERY_PLUGGED_AC in onReceive()
|
/frameworks/base/docs/html/training/monitoring-device-state/ |
D | battery-monitoring.jd | 48 <p>Start by determining the current charge status. The {@link android.os.BatteryManager} 65 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 66 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 67 status == BatteryManager.BATTERY_STATUS_FULL; 70 int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 71 boolean usbCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB; 72 boolean acCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC;</pre> 84 <p>The {@link android.os.BatteryManager} broadcasts an action whenever the device is connected or 105 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 106 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || [all …]
|
/frameworks/base/services/core/java/com/android/server/job/controllers/ |
D | BatteryController.java | 23 import android.os.BatteryManager; 141 filter.addAction(BatteryManager.ACTION_CHARGING); in startTracking() 142 filter.addAction(BatteryManager.ACTION_DISCHARGING); in startTracking() 149 mCharging = batteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); in startTracking() 180 } else if (BatteryManager.ACTION_CHARGING.equals(action)) { in onReceiveInternal() 187 } else if (BatteryManager.ACTION_DISCHARGING.equals(action)) { in onReceiveInternal()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/power/ |
D | PowerUI.java | 25 import android.os.BatteryManager; 51 private int mBatteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; 147 mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 100); in onReceive() 149 mBatteryStatus = intent.getIntExtra(BatteryManager.EXTRA_STATUS, in onReceive() 150 BatteryManager.BATTERY_STATUS_UNKNOWN); in onReceive() 152 mPlugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 1); in onReceive() 154 mInvalidCharger = intent.getIntExtra(BatteryManager.EXTRA_INVALID_CHARGER, 0); in onReceive() 190 && mBatteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN in onReceive()
|
/frameworks/base/docs/html-intl/intl/es/training/monitoring-device-state/ |
D | battery-monitoring.jd | 39 …mendamos que determines el estado de carga actual. {@link android.os.BatteryManager} envía los det… 49 int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 50 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 51 status == BatteryManager.BATTERY_STATUS_FULL; 54 int chargePlug = battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 65 <p>{@link android.os.BatteryManager} emite una acción siempre que el dispositivo se conecta o desco… 79 int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1); 80 boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || 81 status == BatteryManager.BATTERY_STATUS_FULL; 83 int chargePlug = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); [all …]
|
/frameworks/base/services/core/java/com/android/server/pm/ |
D | BackgroundDexOptService.java | 30 import android.os.BatteryManager; 105 int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); in getBatteryLevel() 106 int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); in getBatteryLevel()
|
/frameworks/base/core/java/android/os/ |
D | BatteryManager.java | 31 public class BatteryManager { class 214 public BatteryManager() { in BatteryManager() method in BatteryManager
|
D | BatteryStats.java | 4707 case BatteryManager.BATTERY_STATUS_UNKNOWN: in printNextItem() 4710 case BatteryManager.BATTERY_STATUS_CHARGING: in printNextItem() 4713 case BatteryManager.BATTERY_STATUS_DISCHARGING: in printNextItem() 4716 case BatteryManager.BATTERY_STATUS_NOT_CHARGING: in printNextItem() 4719 case BatteryManager.BATTERY_STATUS_FULL: in printNextItem() 4731 case BatteryManager.BATTERY_HEALTH_UNKNOWN: in printNextItem() 4734 case BatteryManager.BATTERY_HEALTH_GOOD: in printNextItem() 4737 case BatteryManager.BATTERY_HEALTH_OVERHEAT: in printNextItem() 4740 case BatteryManager.BATTERY_HEALTH_DEAD: in printNextItem() 4743 case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: in printNextItem() [all …]
|
/frameworks/base/services/core/java/com/android/server/power/ |
D | WirelessChargerDetector.java | 23 import android.os.BatteryManager; 186 if (isPowered && plugType == BatteryManager.BATTERY_PLUGGED_WIRELESS) { in update() 197 if (plugType != 0 && plugType != BatteryManager.BATTERY_PLUGGED_WIRELESS) { in update()
|
/frameworks/base/packages/Keyguard/src/com/android/keyguard/ |
D | KeyguardUpdateMonitor.java | 37 import android.os.BatteryManager; 72 import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; 73 import static android.os.BatteryManager.BATTERY_STATUS_FULL; 74 import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; 75 import static android.os.BatteryManager.EXTRA_HEALTH; 76 import static android.os.BatteryManager.EXTRA_LEVEL; 77 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT; 78 import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE; 79 import static android.os.BatteryManager.EXTRA_PLUGGED; 80 import static android.os.BatteryManager.EXTRA_STATUS; [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/ |
D | KeyguardIndicationController.java | 26 import android.os.BatteryManager; 230 boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING 231 || status.status == BatteryManager.BATTERY_STATUS_FULL;
|
/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/usage/java/com/android/server/usage/ |
D | UsageStatsService.java | 48 import android.os.BatteryManager; 194 IntentFilter deviceStates = new IntentFilter(BatteryManager.ACTION_CHARGING); in onStart() 195 deviceStates.addAction(BatteryManager.ACTION_DISCHARGING); in onStart() 240 setAppIdleParoled(getContext().getSystemService(BatteryManager.class).isCharging()); in onBootPhase() 287 if (BatteryManager.ACTION_CHARGING.equals(action) in onReceive() 288 || BatteryManager.ACTION_DISCHARGING.equals(action)) { in onReceive() 289 setAppIdleParoled(BatteryManager.ACTION_CHARGING.equals(action)); in onReceive()
|
/frameworks/base/core/java/android/app/ |
D | SystemServiceRegistry.java | 92 import android.os.BatteryManager; 264 registerService(Context.BATTERY_SERVICE, BatteryManager.class, in registerService() 265 new StaticServiceFetcher<BatteryManager>() { in registerService() 267 public BatteryManager createService() { in registerService() argument 268 return new BatteryManager(); in registerService()
|
/frameworks/base/media/java/android/mtp/ |
D | MtpDatabase.java | 30 import android.os.BatteryManager; 145 mBatteryScale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0); 146 int newLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
|
/frameworks/base/docs/html/work/ |
D | cosu.jd | 374 BatteryManager.BATTERY_PLUGGED_AC | 375 BatteryManager.BATTERY_PLUGGED_USB | 376 BatteryManager.BATTERY_PLUGGED_WIRELESS);
|