diff options
Diffstat (limited to 'core/java/android/os/BatteryManager.java')
-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; |