diff options
author | Satish Sampath <satish@android.com> | 2009-06-11 14:05:51 +0100 |
---|---|---|
committer | Satish Sampath <satish@android.com> | 2009-06-11 16:27:29 +0100 |
commit | 35379abd46b68a4efa20035c6c8b9d1faceb4dcc (patch) | |
tree | 115fe06544123d4c98fbba311680fe3213068acf /core/java | |
parent | 174231d89adf4a01f28e6074eb8f743240400c26 (diff) | |
download | frameworks_base-35379abd46b68a4efa20035c6c8b9d1faceb4dcc.zip frameworks_base-35379abd46b68a4efa20035c6c8b9d1faceb4dcc.tar.gz frameworks_base-35379abd46b68a4efa20035c6c8b9d1faceb4dcc.tar.bz2 |
Added attribute queryAfterZeroResults to searchables.
As of now we are just reading it from the xml and not acting upon it, that would come in a subsequent change.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/server/search/SearchableInfo.java | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ public final class SearchableInfo implements Parcelable { 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 @@ public final class SearchableInfo implements Parcelable { 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 @@ public final class SearchableInfo implements Parcelable { } /** + * 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 @@ public final class SearchableInfo implements Parcelable { mSearchInputType = in.readInt(); mSearchImeOptions = in.readInt(); mIncludeInGlobalSearch = in.readInt() != 0; + mQueryAfterZeroResults = in.readInt() != 0; mSuggestAuthority = in.readString(); mSuggestPath = in.readString(); @@ -702,6 +717,7 @@ public final class SearchableInfo implements Parcelable { dest.writeInt(mSearchInputType); dest.writeInt(mSearchImeOptions); dest.writeInt(mIncludeInGlobalSearch ? 1 : 0); + dest.writeInt(mQueryAfterZeroResults ? 1 : 0); dest.writeString(mSuggestAuthority); dest.writeString(mSuggestPath); |