Merge "Expose SearchManager constants for global search"
diff --git a/api/current.xml b/api/current.xml
index 113b9e0..96e7fd6 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -23927,6 +23927,28 @@
visibility="public"
>
</field>
+<field name="EXTRA_SELECT_QUERY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""select_query""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="INTENT_ACTION_GLOBAL_SEARCH"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.search.action.GLOBAL_SEARCH""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="INTENT_ACTION_SEARCHABLES_CHANGED"
type="java.lang.String"
transient="false"
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index 9112be4..981145b 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -1332,20 +1332,11 @@
public final static String EXTRA_DATA_KEY = "intent_extra_data_key";
/**
- * String extra data key for {@link #INTENT_ACTION_GLOBAL_SEARCH} intents. Contains the initial
- * query to show in the global search activity.
- *
- * @hide Pending API council approval
+ * Boolean extra data key for {@link #INTENT_ACTION_GLOBAL_SEARCH} intents. If {@code true},
+ * the initial query should be selected when the global search activity is started, so
+ * that the user can easily replace it with another query.
*/
- public final static String INITIAL_QUERY = "initial_query";
-
- /**
- * Boolean extra data key for {@link Intent#INTENT_ACTION_GLOBAL_SEARCH} intents. If {@code true},
- * the initial query should be selected.
- *
- * @hide Pending API council approval
- */
- public final static String SELECT_INITIAL_QUERY = "select_initial_query";
+ public final static String EXTRA_SELECT_QUERY = "select_query";
/**
* Defines the constants used in the communication between {@link android.app.SearchDialog} and
@@ -1643,10 +1634,12 @@
= "android.search.action.CHANGE_SEARCH_SOURCE";
/**
- * Intent action for finding the global search activity.
+ * Intent action for starting the global search activity.
* The global search provider should handle this intent.
- *
- * @hide Pending API council approval.
+ *
+ * Supported extra data keys: {@link #QUERY},
+ * {@link #EXTRA_SELECT_QUERY},
+ * {@link #APP_DATA}.
*/
public final static String INTENT_ACTION_GLOBAL_SEARCH
= "android.search.action.GLOBAL_SEARCH";
@@ -1823,10 +1816,10 @@
intent.putExtra(APP_DATA, appSearchData);
}
if (!TextUtils.isEmpty(initialQuery)) {
- intent.putExtra(INITIAL_QUERY, initialQuery);
+ intent.putExtra(QUERY, initialQuery);
}
if (selectInitialQuery) {
- intent.putExtra(SELECT_INITIAL_QUERY, selectInitialQuery);
+ intent.putExtra(EXTRA_SELECT_QUERY, selectInitialQuery);
}
try {
if (DBG) Log.d(TAG, "Starting global search: " + intent.toUri(0));