Loading api/current.xml +11 −11 Original line number Diff line number Diff line Loading @@ -2341,6 +2341,17 @@ visibility="public" > </field> <field name="autoUrlDetect" type="int" transient="false" volatile="false" value="16843404" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="background" type="int" transient="false" Loading Loading @@ -3463,17 +3474,6 @@ visibility="public" > </field> <field name="donut_resource_pad20" type="int" transient="false" volatile="false" value="16843404" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="donut_resource_pad3" type="int" transient="false" core/java/android/app/SearchDialog.java +14 −12 Original line number Diff line number Diff line Loading @@ -777,7 +777,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } public void afterTextChanged(Editable s) { if (!mSearchAutoComplete.isPerformingCompletion()) { if (mSearchable.autoUrlDetect() && !mSearchAutoComplete.isPerformingCompletion()) { // The user changed the query, check if it is a URL and if so change the search // button in the soft keyboard to the 'Go' button. int options = (mSearchAutoComplete.getImeOptions() & (~EditorInfo.IME_MASK_ACTION)); Loading Loading @@ -987,7 +987,8 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS && event.getAction() == KeyEvent.ACTION_UP) { v.cancelLongPress(); // If this is a url entered by the user and we displayed the 'Go' button which if (mSearchable.autoUrlDetect()) { // If this is a url entered by the user & we displayed the 'Go' button which // the user clicked, launch the url instead of using it as a search query. if ((mSearchAutoCompleteImeOptions & EditorInfo.IME_MASK_ACTION) == EditorInfo.IME_ACTION_GO) { Loading @@ -999,6 +1000,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS // Launch as a regular search. launchQuerySearch(); } } return true; } if (event.getAction() == KeyEvent.ACTION_DOWN) { Loading core/java/android/server/search/SearchableInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -666,6 +669,16 @@ public final class SearchableInfo implements Parcelable { return mQueryAfterZeroResults; } /** * 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. */ Loading Loading @@ -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(); Loading Loading @@ -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); Loading core/res/res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -2888,6 +2888,14 @@ attribute.</i> --> <attr name="searchSettingsDescription" format="string" /> <!-- If provided and <code>true</code>, 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 <code>false</code> any URLs entered are treated as normal query text. The default value is <code>false</code>. <i>Optional attribute.</i>. --> <attr name="autoUrlDetect" format="boolean" /> </declare-styleable> <!-- In order to process special action keys during search, you must define them using Loading core/res/res/values/public.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,7 @@ <public type="attr" name="progressBarStyleLargeInverse" /> <public type="attr" name="searchSettingsDescription" /> <public type="attr" name="textColorPrimaryInverseDisableOnly" /> <public type="attr" name="autoUrlDetect" /> <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" /> Loading Loading
api/current.xml +11 −11 Original line number Diff line number Diff line Loading @@ -2341,6 +2341,17 @@ visibility="public" > </field> <field name="autoUrlDetect" type="int" transient="false" volatile="false" value="16843404" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="background" type="int" transient="false" Loading Loading @@ -3463,17 +3474,6 @@ visibility="public" > </field> <field name="donut_resource_pad20" type="int" transient="false" volatile="false" value="16843404" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="donut_resource_pad3" type="int" transient="false"
core/java/android/app/SearchDialog.java +14 −12 Original line number Diff line number Diff line Loading @@ -777,7 +777,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } public void afterTextChanged(Editable s) { if (!mSearchAutoComplete.isPerformingCompletion()) { if (mSearchable.autoUrlDetect() && !mSearchAutoComplete.isPerformingCompletion()) { // The user changed the query, check if it is a URL and if so change the search // button in the soft keyboard to the 'Go' button. int options = (mSearchAutoComplete.getImeOptions() & (~EditorInfo.IME_MASK_ACTION)); Loading Loading @@ -987,7 +987,8 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS && event.getAction() == KeyEvent.ACTION_UP) { v.cancelLongPress(); // If this is a url entered by the user and we displayed the 'Go' button which if (mSearchable.autoUrlDetect()) { // If this is a url entered by the user & we displayed the 'Go' button which // the user clicked, launch the url instead of using it as a search query. if ((mSearchAutoCompleteImeOptions & EditorInfo.IME_MASK_ACTION) == EditorInfo.IME_ACTION_GO) { Loading @@ -999,6 +1000,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS // Launch as a regular search. launchQuerySearch(); } } return true; } if (event.getAction() == KeyEvent.ACTION_DOWN) { Loading
core/java/android/server/search/SearchableInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -666,6 +669,16 @@ public final class SearchableInfo implements Parcelable { return mQueryAfterZeroResults; } /** * 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. */ Loading Loading @@ -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(); Loading Loading @@ -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); Loading
core/res/res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -2888,6 +2888,14 @@ attribute.</i> --> <attr name="searchSettingsDescription" format="string" /> <!-- If provided and <code>true</code>, 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 <code>false</code> any URLs entered are treated as normal query text. The default value is <code>false</code>. <i>Optional attribute.</i>. --> <attr name="autoUrlDetect" format="boolean" /> </declare-styleable> <!-- In order to process special action keys during search, you must define them using Loading
core/res/res/values/public.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,7 @@ <public type="attr" name="progressBarStyleLargeInverse" /> <public type="attr" name="searchSettingsDescription" /> <public type="attr" name="textColorPrimaryInverseDisableOnly" /> <public type="attr" name="autoUrlDetect" /> <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" /> Loading