Loading core/java/android/app/SearchDialog.java +1 −1 Original line number Diff line number Diff line Loading @@ -472,7 +472,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS closeSuggestionsAdapter(); mSearchAutoComplete.setDropDownAnimationStyle(0); // no animation mSearchAutoComplete.setThreshold(0); // always allow zero-query suggestions mSearchAutoComplete.setThreshold(mSearchable.getSuggestThreshold()); if (mGlobalSearchMode) { mSearchAutoComplete.setDropDownAlwaysVisible(true); // fill space until results come in Loading core/java/android/server/search/SearchableInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ public final class SearchableInfo implements Parcelable { private String mSuggestSelection = null; private String mSuggestIntentAction = null; private String mSuggestIntentData = null; private int mSuggestThreshold = 0; private ActionKeyInfo mActionKeyList = null; private String mSuggestProviderPackage = null; Loading Loading @@ -139,6 +140,16 @@ public final class SearchableInfo implements Parcelable { return mSuggestIntentData; } /** * Gets the suggestion threshold for use with these suggestions. * * @return The value of the <code>searchSuggestThreshold</code> attribute, * or 0 if the attribute is not set. */ public int getSuggestThreshold() { return mSuggestThreshold; } /** * Get the context for the searchable activity. * Loading Loading @@ -238,6 +249,8 @@ public final class SearchableInfo implements Parcelable { com.android.internal.R.styleable.Searchable_searchSuggestIntentAction); mSuggestIntentData = a.getString( com.android.internal.R.styleable.Searchable_searchSuggestIntentData); mSuggestThreshold = a.getInt( com.android.internal.R.styleable.Searchable_searchSuggestThreshold, 0); } mVoiceSearchMode = a.getInt(com.android.internal.R.styleable.Searchable_voiceSearchMode, 0); Loading Loading @@ -600,6 +613,7 @@ public final class SearchableInfo implements Parcelable { mSuggestSelection = in.readString(); mSuggestIntentAction = in.readString(); mSuggestIntentData = in.readString(); mSuggestThreshold = in.readInt(); mActionKeyList = null; int count = in.readInt(); Loading Loading @@ -636,6 +650,7 @@ public final class SearchableInfo implements Parcelable { dest.writeString(mSuggestSelection); dest.writeString(mSuggestIntentAction); dest.writeString(mSuggestIntentData); dest.writeInt(mSuggestThreshold); // This is usually a very short linked list so we'll just pre-count it ActionKeyInfo nextKeyInfo = mActionKeyList; Loading core/res/res/values/attrs.xml +5 −1 Original line number Diff line number Diff line Loading @@ -2781,6 +2781,10 @@ when the user clicks a suggestion. <i>Optional attribute.</i> --> <attr name="searchSuggestIntentData" format="string" /> <!-- If provided, this is the minimun number of characters needed to trigger search suggestions. The default value is 0. <i>Optional attribute.</i> --> <attr name="searchSuggestThreshold" format="integer" /> </declare-styleable> <!-- In order to process special action keys during search, you must define them using Loading Loading
core/java/android/app/SearchDialog.java +1 −1 Original line number Diff line number Diff line Loading @@ -472,7 +472,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS closeSuggestionsAdapter(); mSearchAutoComplete.setDropDownAnimationStyle(0); // no animation mSearchAutoComplete.setThreshold(0); // always allow zero-query suggestions mSearchAutoComplete.setThreshold(mSearchable.getSuggestThreshold()); if (mGlobalSearchMode) { mSearchAutoComplete.setDropDownAlwaysVisible(true); // fill space until results come in Loading
core/java/android/server/search/SearchableInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ public final class SearchableInfo implements Parcelable { private String mSuggestSelection = null; private String mSuggestIntentAction = null; private String mSuggestIntentData = null; private int mSuggestThreshold = 0; private ActionKeyInfo mActionKeyList = null; private String mSuggestProviderPackage = null; Loading Loading @@ -139,6 +140,16 @@ public final class SearchableInfo implements Parcelable { return mSuggestIntentData; } /** * Gets the suggestion threshold for use with these suggestions. * * @return The value of the <code>searchSuggestThreshold</code> attribute, * or 0 if the attribute is not set. */ public int getSuggestThreshold() { return mSuggestThreshold; } /** * Get the context for the searchable activity. * Loading Loading @@ -238,6 +249,8 @@ public final class SearchableInfo implements Parcelable { com.android.internal.R.styleable.Searchable_searchSuggestIntentAction); mSuggestIntentData = a.getString( com.android.internal.R.styleable.Searchable_searchSuggestIntentData); mSuggestThreshold = a.getInt( com.android.internal.R.styleable.Searchable_searchSuggestThreshold, 0); } mVoiceSearchMode = a.getInt(com.android.internal.R.styleable.Searchable_voiceSearchMode, 0); Loading Loading @@ -600,6 +613,7 @@ public final class SearchableInfo implements Parcelable { mSuggestSelection = in.readString(); mSuggestIntentAction = in.readString(); mSuggestIntentData = in.readString(); mSuggestThreshold = in.readInt(); mActionKeyList = null; int count = in.readInt(); Loading Loading @@ -636,6 +650,7 @@ public final class SearchableInfo implements Parcelable { dest.writeString(mSuggestSelection); dest.writeString(mSuggestIntentAction); dest.writeString(mSuggestIntentData); dest.writeInt(mSuggestThreshold); // This is usually a very short linked list so we'll just pre-count it ActionKeyInfo nextKeyInfo = mActionKeyList; Loading
core/res/res/values/attrs.xml +5 −1 Original line number Diff line number Diff line Loading @@ -2781,6 +2781,10 @@ when the user clicks a suggestion. <i>Optional attribute.</i> --> <attr name="searchSuggestIntentData" format="string" /> <!-- If provided, this is the minimun number of characters needed to trigger search suggestions. The default value is 0. <i>Optional attribute.</i> --> <attr name="searchSuggestThreshold" format="integer" /> </declare-styleable> <!-- In order to process special action keys during search, you must define them using Loading