diff --git a/api/current.xml b/api/current.xml index bd1c428205140..0495764a0c0c0 100644 --- a/api/current.xml +++ b/api/current.xml @@ -35829,17 +35829,6 @@ visibility="public" > - - + + + + + + + + + + + + + + + + + + + + sticky broadcast containing the + * charging state, level, and other information about the battery. + * See {@link android.os.BatteryManager} for documentation on the + * contents of the Intent. * *

* You can not receive this through components declared * in manifests, only by explicitly registering for it with * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) - * Context.registerReceiver()}. + * Context.registerReceiver()}. See {@link #ACTION_BATTERY_LOW}, + * {@link #ACTION_BATTERY_OKAY}, {@link #ACTION_POWER_CONNECTED}, + * and {@link #ACTION_POWER_DISCONNECTED} for distinct battery-related + * broadcasts that are sent and can be received through manifest + * receivers. * *

This is a protected intent that can only be sent * by the system. @@ -1434,7 +1440,8 @@ public class Intent implements Parcelable { */ public static final String ACTION_REQUEST_SHUTDOWN = "android.intent.action.ACTION_REQUEST_SHUTDOWN"; /** - * Broadcast Action: Indicates low memory condition on the device + * Broadcast Action: A sticky broadcast that indicates low memory + * condition on the device * *

This is a protected intent that can only be sent * by the system. @@ -1710,6 +1717,18 @@ public class Intent implements Parcelable { public static final String ACTION_REBOOT = "android.intent.action.REBOOT"; + /** + * Broadcast Action: A sticky broadcast indicating the phone was docked + * or undocked. Includes the extra + * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. + * This is intended for monitoring the current dock state. + * To launch an activity from a dock state change, use {@link #CATEGORY_CAR_DOCK} + * or {@link #CATEGORY_DESK_DOCK} instead. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_DOCK_EVENT = + "android.intent.action.DOCK_EVENT"; + /** * Broadcast Action: a remote intent is to be broadcasted. * @@ -1720,6 +1739,7 @@ public class Intent implements Parcelable { * does not trust intent broadcasts from arbitrary intent senders, it should require * the sender to hold certain permissions so only trusted sender's broadcast will be * let through. + * @hide */ public static final String ACTION_REMOTE_INTENT = "android.intent.action.REMOTE_INTENT"; @@ -1878,16 +1898,6 @@ public class Intent implements Parcelable { @SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String CATEGORY_DESK_DOCK = "android.intent.category.DESK_DOCK"; - /** - * Broadcast Action: The phone was docked or undocked. Includes the extra - * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. - * This is intended for monitoring the current dock state. - * To launch an activity from a dock state change, use {@link #CATEGORY_CAR_DOCK} - * or {@link #CATEGORY_DESK_DOCK} instead. - */ - @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) - public static final String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT"; - // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Standard extra data keys. diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java index 8f1a756b295ce..44b73c52dd052 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; diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index b710acb6d7cd2..5ee21b8133c1d 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -78,6 +78,14 @@ A value of -1 means no change in orientation by default. --> -1 + + false + + + true +