Add MediaRouter API.
This is just the initial state tracking. Still to go is
actually triggering Bluetooth A2DP correctly and tracking
process state in the system server.
Change-Id: I33031d52799d6e2d7208910da833831085cc3677
diff --git a/core/java/android/view/ActionProvider.java b/core/java/android/view/ActionProvider.java
index ed976ab..9150d19 100644
--- a/core/java/android/view/ActionProvider.java
+++ b/core/java/android/view/ActionProvider.java
@@ -19,28 +19,25 @@
import android.content.Context;
/**
- * This class is a mediator for accomplishing a given task, for example sharing a file.
- * It is responsible for creating a view that performs an action that accomplishes the task.
- * This class also implements other functions such a performing a default action.
- * <p>
- * An ActionProvider can be optionally specified for a {@link MenuItem} and in such a
- * case it will be responsible for creating the action view that appears in the
- * {@link android.app.ActionBar} as a substitute for the menu item when the item is
- * displayed as an action item. Also the provider is responsible for performing a
- * default action if a menu item placed on the overflow menu of the ActionBar is
- * selected and none of the menu item callbacks has handled the selection. For this
- * case the provider can also optionally provide a sub-menu for accomplishing the
- * task at hand.
- * </p>
- * <p>
- * There are two ways for using an action provider for creating and handling of action views:
+ * An ActionProvider defines rich menu interaction in a single component.
+ * ActionProvider can generate action views for use in the action bar,
+ * dynamically populate submenus of a MenuItem, and handle default menu
+ * item invocations.
+ *
+ * <p>An ActionProvider can be optionally specified for a {@link MenuItem} and will be
+ * responsible for creating the action view that appears in the {@link android.app.ActionBar}
+ * in place of a simple button in the bar. When the menu item is presented in a way that
+ * does not allow custom action views, (e.g. in an overflow menu,) the ActionProvider
+ * can perform a default action.</p>
+ *
+ * <p>There are two ways to use an action provider:
* <ul>
* <li>
- * Setting the action provider on a {@link MenuItem} directly by calling
+ * Set the action provider on a {@link MenuItem} directly by calling
* {@link MenuItem#setActionProvider(ActionProvider)}.
* </li>
* <li>
- * Declaring the action provider in the menu XML resource. For example:
+ * Declare the action provider in an XML menu resource. For example:
* <pre>
* <code>
* <item android:id="@+id/my_menu_item"
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index abd7e92..f1448a8 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -636,6 +636,12 @@
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="signature" />
+ <!-- Allows an application to route media output to other devices. -->
+ <permission android:name="android.permission.ROUTE_MEDIA_OUTPUT"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:label="@string/permlab_route_media_output"
+ android:description="@string/permdesc_route_media_output" />
+
<!-- =========================================== -->
<!-- Permissions associated with telephony state -->
<!-- =========================================== -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 51be22d..801fdf6 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -881,6 +881,11 @@
<java-symbol type="string" name="granularity_label_word" />
<java-symbol type="string" name="granularity_label_link" />
<java-symbol type="string" name="granularity_label_line" />
+ <java-symbol type="string" name="default_audio_route_name" />
+ <java-symbol type="string" name="default_audio_route_name_headphones" />
+ <java-symbol type="string" name="default_audio_route_name_dock_speakers" />
+ <java-symbol type="string" name="default_audio_route_name_hdmi" />
+ <java-symbol type="string" name="default_audio_route_category_name" />
<java-symbol type="plurals" name="abbrev_in_num_days" />
<java-symbol type="plurals" name="abbrev_in_num_hours" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 21efe4e..c143a4e 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3102,6 +3102,11 @@
<!-- Description of an application permission, used to invoke default container service to copy content. -->
<string name="permdesc_copyProtectedData">Allows the app to invoke default container service to copy content. Not for use by normal apps.</string>
+ <!-- Title of an application permission that lets an application route media output. -->
+ <string name="permlab_route_media_output">Route media output</string>
+ <!-- Description of an application permission that lets an application route media output. -->
+ <string name="permdesc_route_media_output">Allows an application to route media output to other external devices.</string>
+
<!-- Shown in the tutorial for tap twice for zoom control. -->
<string name="tutorial_double_tap_to_zoom_message_short">Touch twice for zoom control</string>
@@ -3516,4 +3521,25 @@
from the activity resolver to use just this once. [CHAR LIMIT=25] -->
<string name="activity_resolver_use_once">Just once</string>
+ <!-- Name of the default audio route when nothing is connected to
+ a headphone or other wired audio output jack. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_name">Phone speaker</string>
+
+ <!-- Name of the default audio route for tablets when nothing
+ is connected to a headphone or other wired audio output jack. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_name" product="tablet">Tablet speakers</string>
+
+ <!-- Name of the default audio route when wired headphones are
+ connected. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_name_headphones">Headphones</string>
+
+ <!-- Name of the default audio route when an audio dock is connected. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_name_dock_speakers">Dock speakers</string>
+
+ <!-- Name of the default audio route when HDMI is connected. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_name_hdmi">HDMI audio</string>
+
+ <!-- Name of the default audio route category. [CHAR LIMIT=25] -->
+ <string name="default_audio_route_category_name">System</string>
+
</resources>