Merge change 5879 into donut

* changes:
  Represent new searchSettingsDescription attribute on searchables in SearchableInfo.
This commit is contained in:
Android (Google) Code Review
2009-07-01 08:51:31 -07:00

View File

@@ -67,6 +67,7 @@ public final class SearchableInfo implements Parcelable {
private final int mSearchImeOptions; private final int mSearchImeOptions;
private final boolean mIncludeInGlobalSearch; private final boolean mIncludeInGlobalSearch;
private final boolean mQueryAfterZeroResults; private final boolean mQueryAfterZeroResults;
private final String mSettingsDescription;
private final String mSuggestAuthority; private final String mSuggestAuthority;
private final String mSuggestPath; private final String mSuggestPath;
private final String mSuggestSelection; private final String mSuggestSelection;
@@ -135,6 +136,14 @@ public final class SearchableInfo implements Parcelable {
return 0 != (mSearchMode & SEARCH_MODE_QUERY_REWRITE_FROM_TEXT); return 0 != (mSearchMode & SEARCH_MODE_QUERY_REWRITE_FROM_TEXT);
} }
/**
* Gets the description to use for this source in system search settings, or null if
* none has been specified.
*/
public String getSettingsDescription() {
return mSettingsDescription;
}
/** /**
* Retrieve the path for obtaining search suggestions. * Retrieve the path for obtaining search suggestions.
* *
@@ -280,6 +289,8 @@ public final class SearchableInfo implements Parcelable {
mQueryAfterZeroResults = a.getBoolean( mQueryAfterZeroResults = a.getBoolean(
com.android.internal.R.styleable.Searchable_queryAfterZeroResults, false); com.android.internal.R.styleable.Searchable_queryAfterZeroResults, false);
mSettingsDescription = a.getString(
com.android.internal.R.styleable.Searchable_searchSettingsDescription);
mSuggestAuthority = a.getString( mSuggestAuthority = a.getString(
com.android.internal.R.styleable.Searchable_searchSuggestAuthority); com.android.internal.R.styleable.Searchable_searchSuggestAuthority);
mSuggestPath = a.getString( mSuggestPath = a.getString(
@@ -448,6 +459,7 @@ public final class SearchableInfo implements Parcelable {
+ ",suggestAuthority=" + searchable.getSuggestAuthority() + ",suggestAuthority=" + searchable.getSuggestAuthority()
+ ",target=" + searchable.getSearchActivity().getClassName() + ",target=" + searchable.getSearchActivity().getClassName()
+ ",global=" + searchable.shouldIncludeInGlobalSearch() + ",global=" + searchable.shouldIncludeInGlobalSearch()
+ ",settingsDescription=" + searchable.getSettingsDescription()
+ ",threshold=" + searchable.getSuggestThreshold()); + ",threshold=" + searchable.getSuggestThreshold());
} else { } else {
Log.d(LOG_TAG, "Checked " + activityInfo.name + ", no searchable meta-data"); Log.d(LOG_TAG, "Checked " + activityInfo.name + ", no searchable meta-data");
@@ -687,6 +699,7 @@ public final class SearchableInfo implements Parcelable {
mIncludeInGlobalSearch = in.readInt() != 0; mIncludeInGlobalSearch = in.readInt() != 0;
mQueryAfterZeroResults = in.readInt() != 0; mQueryAfterZeroResults = in.readInt() != 0;
mSettingsDescription = in.readString();
mSuggestAuthority = in.readString(); mSuggestAuthority = in.readString();
mSuggestPath = in.readString(); mSuggestPath = in.readString();
mSuggestSelection = in.readString(); mSuggestSelection = in.readString();
@@ -723,6 +736,7 @@ public final class SearchableInfo implements Parcelable {
dest.writeInt(mIncludeInGlobalSearch ? 1 : 0); dest.writeInt(mIncludeInGlobalSearch ? 1 : 0);
dest.writeInt(mQueryAfterZeroResults ? 1 : 0); dest.writeInt(mQueryAfterZeroResults ? 1 : 0);
dest.writeString(mSettingsDescription);
dest.writeString(mSuggestAuthority); dest.writeString(mSuggestAuthority);
dest.writeString(mSuggestPath); dest.writeString(mSuggestPath);
dest.writeString(mSuggestSelection); dest.writeString(mSuggestSelection);