summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/Intent.java
diff options
context:
space:
mode:
authorTobias Haamel <haamel@google.com>2010-02-09 23:09:17 +0100
committerTobias Haamel <haamel@google.com>2010-02-11 21:25:58 +0100
commit27b28b3f62bd3b54fa13acd5d035940b9be464f3 (patch)
treed1f44096f7071bbc53e5bc979117be8e0f4aa55c /core/java/android/content/Intent.java
parentd5663a108760de672b130ffabd4f6632982f75e5 (diff)
downloadframeworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.zip
frameworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.tar.gz
frameworks_base-27b28b3f62bd3b54fa13acd5d035940b9be464f3.tar.bz2
Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of precedence for the resources now in such a way that the ui mode needs to be specified after the orientation and before the density. The ui mode can be set, like it is done for the locale, as follows: IActivityManager am = ActivityManagerNative.getDefault(); Configuration config = am.getConfiguration(); config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY; am.updateConfiguration(config); To allow users to disable the car mode and set the night mode the IUiModeManager interface is used. The automatic night mode switching will be added in a separate change.
Diffstat (limited to 'core/java/android/content/Intent.java')
-rw-r--r--core/java/android/content/Intent.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index c32999f..e36eba9 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1816,7 +1816,9 @@ public class Intent implements Parcelable, Cloneable {
/**
* 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.
+ * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. It also
+ * includes the boolean extra field {@link #EXTRA_CAR_MODE_ENABLED}, indicating
+ * the state of the car mode.
* 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.
@@ -2152,6 +2154,12 @@ public class Intent implements Parcelable, Cloneable {
public static final int EXTRA_DOCK_STATE_CAR = 2;
/**
+ * Used as an boolean extra field in {@link android.content.Intent#ACTION_DOCK_EVENT}
+ * intents to indicate that the car mode is enabled or not.
+ */
+ public static final String EXTRA_CAR_MODE_ENABLED = "android.intent.extra.CAR_MODE_ENABLED";
+
+ /**
* Boolean that can be supplied as meta-data with a dock activity, to
* indicate that the dock should take over the home key when it is active.
*/