From c9f4eaf4388087f23aa97e55349850f0902a19d3 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Wed, 12 Aug 2009 15:15:43 -0500 Subject: Dock changes:Docking station intents Docking station intents for dock switch driver. Add DockObserver and updated Intent.java and systemserver.jave Signed-off-by: Dan Murphy modified: core/java/android/content/Intent.java new file: services/java/com/android/server/DockObserver.java modified: services/java/com/android/server/SystemServer.java Docking station updates Add constants for the dock Signed-off-by: Dan Murphy Signed-off-by: Mike Lockwood --- core/java/android/content/Intent.java | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'core/java/android/content/Intent.java') diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index f9b082f..a3517f8 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1838,6 +1838,14 @@ public class Intent implements Parcelable { */ public static final String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST = "android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST"; + + /** + * Broadcast Action: The phone was docked or undocked. Includes the extra + * field {@link #EXTRA_DOCK_STATE}, containing the current dock state. + * @hide + */ + public static final String ACTION_DOCK_EVENT = "android.intent.action.DOCK_EVENT"; + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Standard extra data keys. @@ -1960,6 +1968,37 @@ public class Intent implements Parcelable { public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT"; /** + * Used as an int extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} + * intents to request the dock state. Possible values are + * {@link android.content.Intent#ACTION_DOCK_STATE_UNDOCKED}, + * {@link android.content.Intent#ACTION_DOCK_STATE_DESK}, or + * {@link android.content.Intent#ACTION_DOCK_STATE_CAR}. + * @hide + */ + public static final String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE"; + + /** + * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} + * to represent that the phone is not in any dock. + * @hide + */ + public static final int EXTRA_DOCK_STATE_UNDOCKED = 0; + + /** + * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} + * to represent that the phone is in a desk dock. + * @hide + */ + public static final int EXTRA_DOCK_STATE_DESK = 1; + + /** + * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} + * to represent that the phone is in a car dock. + * @hide + */ + public static final int EXTRA_DOCK_STATE_CAR = 2; + + /** * Used as a parcelable extra field in {@link #ACTION_APP_ERROR}, containing * the bug report. * -- cgit v1.1