Merge change 3899 into donut
* changes:
GpsLocationProvider: Add hooks for GPS location injection.
diff --git a/api/current.xml b/api/current.xml
index cb348e1..f30c505 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -3518,17 +3518,6 @@
visibility="public"
>
</field>
-<field name="donut_resource_pad30"
- type="int"
- transient="false"
- volatile="false"
- value="16843394"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="donut_resource_pad4"
type="int"
transient="false"
@@ -6840,6 +6829,17 @@
visibility="public"
>
</field>
+<field name="queryAfterZeroResults"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843394"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="radioButtonStyle"
type="int"
transient="false"
@@ -62837,7 +62837,7 @@
type="float"
transient="false"
volatile="false"
- value="0.0010f"
+ value="0.001f"
static="true"
final="true"
deprecated="not deprecated"
diff --git a/core/java/android/server/search/SearchableInfo.java b/core/java/android/server/search/SearchableInfo.java
index c083142..4df7368 100644
--- a/core/java/android/server/search/SearchableInfo.java
+++ b/core/java/android/server/search/SearchableInfo.java
@@ -66,6 +66,7 @@
private final int mSearchInputType;
private final int mSearchImeOptions;
private final boolean mIncludeInGlobalSearch;
+ private final boolean mQueryAfterZeroResults;
private final String mSuggestAuthority;
private final String mSuggestPath;
private final String mSuggestSelection;
@@ -276,6 +277,8 @@
EditorInfo.IME_ACTION_SEARCH);
mIncludeInGlobalSearch = a.getBoolean(
com.android.internal.R.styleable.Searchable_includeInGlobalSearch, false);
+ mQueryAfterZeroResults = a.getBoolean(
+ com.android.internal.R.styleable.Searchable_queryAfterZeroResults, false);
mSuggestAuthority = a.getString(
com.android.internal.R.styleable.Searchable_searchSuggestAuthority);
@@ -637,6 +640,17 @@
}
/**
+ * Checks whether this searchable activity should be invoked after a query returned zero
+ * results.
+ *
+ * @return The value of the <code>queryAfterZeroResults</code> attribute,
+ * or <code>false</code> if the attribute is not set.
+ */
+ public boolean queryAfterZeroResults() {
+ return mQueryAfterZeroResults;
+ }
+
+ /**
* Support for parcelable and aidl operations.
*/
public static final Parcelable.Creator<SearchableInfo> CREATOR
@@ -667,6 +681,7 @@
mSearchInputType = in.readInt();
mSearchImeOptions = in.readInt();
mIncludeInGlobalSearch = in.readInt() != 0;
+ mQueryAfterZeroResults = in.readInt() != 0;
mSuggestAuthority = in.readString();
mSuggestPath = in.readString();
@@ -702,6 +717,7 @@
dest.writeInt(mSearchInputType);
dest.writeInt(mSearchImeOptions);
dest.writeInt(mIncludeInGlobalSearch ? 1 : 0);
+ dest.writeInt(mQueryAfterZeroResults ? 1 : 0);
dest.writeString(mSuggestAuthority);
dest.writeString(mSuggestPath);
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index c13bf775..99fe9c8 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2849,6 +2849,14 @@
The default value is <code>false</code>. <i>Optional attribute.</i>. -->
<attr name="includeInGlobalSearch" format="boolean" />
+ <!-- If provided and <code>true</code>, this searchable activity will be invoked for all
+ queries in a particular session. If set to <code>false</code> and the activity
+ returned zero results for a query, it will not be invoked again in that session for
+ supersets of that zero-results query. For example, if the activity returned zero
+ results for "bo", it would not be queried again for "bob".
+ The default value is <code>false</code>. <i>Optional attribute.</i>. -->
+ <attr name="queryAfterZeroResults" format="boolean" />
+
</declare-styleable>
<!-- In order to process special action keys during search, you must define them using
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a50f3f9..e5a58b1 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1115,6 +1115,7 @@
<public type="attr" name="backupAgent" />
<public type="attr" name="allowBackup" />
<public type="attr" name="glEsVersion" />
+ <public type="attr" name="queryAfterZeroResults" />
<public-padding type="attr" name="donut_resource_pad" end="0x0101029f" />