summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/search
diff options
context:
space:
mode:
authorSatish Sampath <satish@android.com>2009-07-08 14:54:11 +0100
committerSatish Sampath <satish@android.com>2009-07-08 15:09:08 +0100
commitd21572cd446e56efe94689324107927ac2bffd2a (patch)
treeef2156194d9a728a292f522fff80350acef16d67 /core/java/android/server/search
parentd6fe243c1c6d5e994cacede8110eef736767bd7f (diff)
downloadframeworks_base-d21572cd446e56efe94689324107927ac2bffd2a.zip
frameworks_base-d21572cd446e56efe94689324107927ac2bffd2a.tar.gz
frameworks_base-d21572cd446e56efe94689324107927ac2bffd2a.tar.bz2
NEW_API: Expose autoUrlDetect searchable attribute.
If provided and true, URLs entered in the search dialog while searching within this activity would be detected and treated as URLs (show a 'go' button in the keyboard and invoke the browser directly when user launches the URL instead of passing the URL to the activity). If set to false any URLs entered are treated as normal query text. The default value is false. This is an optional attribute.
Diffstat (limited to 'core/java/android/server/search')
-rw-r--r--core/java/android/server/search/SearchableInfo.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/server/search/SearchableInfo.java b/core/java/android/server/search/SearchableInfo.java
index 8ef1f15..283555a 100644
--- a/core/java/android/server/search/SearchableInfo.java
+++ b/core/java/android/server/search/SearchableInfo.java
@@ -67,6 +67,7 @@ public final class SearchableInfo implements Parcelable {
private final int mSearchImeOptions;
private final boolean mIncludeInGlobalSearch;
private final boolean mQueryAfterZeroResults;
+ private final boolean mAutoUrlDetect;
private final String mSettingsDescription;
private final String mSuggestAuthority;
private final String mSuggestPath;
@@ -288,6 +289,8 @@ public final class SearchableInfo implements Parcelable {
com.android.internal.R.styleable.Searchable_includeInGlobalSearch, false);
mQueryAfterZeroResults = a.getBoolean(
com.android.internal.R.styleable.Searchable_queryAfterZeroResults, false);
+ mAutoUrlDetect = a.getBoolean(
+ com.android.internal.R.styleable.Searchable_autoUrlDetect, false);
mSettingsDescription = a.getString(
com.android.internal.R.styleable.Searchable_searchSettingsDescription);
@@ -667,6 +670,16 @@ public final class SearchableInfo implements Parcelable {
}
/**
+ * Checks whether this searchable activity has auto URL detect turned on.
+ *
+ * @return The value of the <code>autoUrlDetect</code> attribute,
+ * or <code>false</code> if the attribute is not set.
+ */
+ public boolean autoUrlDetect() {
+ return mAutoUrlDetect;
+ }
+
+ /**
* Support for parcelable and aidl operations.
*/
public static final Parcelable.Creator<SearchableInfo> CREATOR
@@ -698,6 +711,7 @@ public final class SearchableInfo implements Parcelable {
mSearchImeOptions = in.readInt();
mIncludeInGlobalSearch = in.readInt() != 0;
mQueryAfterZeroResults = in.readInt() != 0;
+ mAutoUrlDetect = in.readInt() != 0;
mSettingsDescription = in.readString();
mSuggestAuthority = in.readString();
@@ -735,6 +749,7 @@ public final class SearchableInfo implements Parcelable {
dest.writeInt(mSearchImeOptions);
dest.writeInt(mIncludeInGlobalSearch ? 1 : 0);
dest.writeInt(mQueryAfterZeroResults ? 1 : 0);
+ dest.writeInt(mAutoUrlDetect ? 1 : 0);
dest.writeString(mSettingsDescription);
dest.writeString(mSuggestAuthority);