diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-09-19 14:03:05 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-09-19 14:03:05 -0700 |
| commit | edd9316ca9b3b24d54e8a2468927da7e813098fc (patch) | |
| tree | 3b79a0c7b48e23623480abebbaa9fc9708175006 /core/java/android/os | |
| parent | efa199f016985b0a9d0471e42c803ee9f7941f0e (diff) | |
| download | frameworks_base-edd9316ca9b3b24d54e8a2468927da7e813098fc.zip frameworks_base-edd9316ca9b3b24d54e8a2468927da7e813098fc.tar.gz frameworks_base-edd9316ca9b3b24d54e8a2468927da7e813098fc.tar.bz2 | |
Add better APIs for the battery status, and other cleanup.
Also add new configs for keeping screen on while docked, which will
be used elsewhere.
Change-Id: Ifaa1118f14fd850ac809895f9a5c9e8c413259b8
Diffstat (limited to 'core/java/android/os')
| -rw-r--r-- | core/java/android/os/BatteryManager.java | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java index 8f1a756..44b73c5 100644 --- a/core/java/android/os/BatteryManager.java +++ b/core/java/android/os/BatteryManager.java @@ -18,10 +18,73 @@ package android.os; /** * The BatteryManager class contains strings and constants used for values - * in the ACTION_BATTERY_CHANGED Intent. + * in the {@link android.content.Intent#ACTION_BATTERY_CHANGED} Intent. */ public class BatteryManager { - + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the current status constant. + */ + public static final String EXTRA_STATUS = "status"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the current health constant. + */ + public static final String EXTRA_HEALTH = "health"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * boolean indicating whether a battery is present. + */ + public static final String EXTRA_PRESENT = "present"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer field containing the current battery level, from 0 to + * {@link #EXTRA_SCALE}. + */ + public static final String EXTRA_LEVEL = "level"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the maximum battery level. + */ + public static final String EXTRA_SCALE = "scale"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the resource ID of a small status bar icon + * indicating the current battery state. + */ + public static final String EXTRA_ICON_SMALL = "icon-small"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer indicating whether the device is plugged in to a power + * source; 0 means it is on battery, other constants are different + * types of power sources. + */ + public static final String EXTRA_PLUGGED = "plugged"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the current battery voltage level. + */ + public static final String EXTRA_VOLTAGE = "voltage"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * integer containing the current battery temperature. + */ + public static final String EXTRA_TEMPERATURE = "temperature"; + + /** + * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}: + * String describing the technology of the current battery. + */ + public static final String EXTRA_TECHNOLOGY = "technology"; + // values for "status" field in the ACTION_BATTERY_CHANGED Intent public static final int BATTERY_STATUS_UNKNOWN = 1; public static final int BATTERY_STATUS_CHARGING = 2; |
