diff options
author | Satish Sampath <satish@android.com> | 2009-05-29 15:38:04 +0100 |
---|---|---|
committer | Satish Sampath <satish@android.com> | 2009-06-02 16:34:14 +0100 |
commit | 40add5db792311bdee1a2865c827e43d8a28d302 (patch) | |
tree | e02e4060cc9bdc0d5874724a151a3e56c39f2881 | |
parent | f6c2f6a1eb5f795036559740af48ba8d7ead1e84 (diff) | |
download | GoogleSearch-40add5db792311bdee1a2865c827e43d8a28d302.tar.gz |
Make the GoogleSearch provider understand action.WEB_SEARCH
The search dialog & browser are going to use the system default handler for action.WEB_SEARCH and use that for suggestions & launching web searches. This change makes GoogleSearch provider compatible with that model so it can be used for google searches and suggestions. With this change, Google Search also appears as an item in the Web Search providers list in system search settings.
-rw-r--r-- | AndroidManifest.xml | 24 | ||||
-rw-r--r-- | src/com/android/googlesearch/GoogleSearch.java | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2f88c3f..0cd5033 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3,16 +3,16 @@ /* ** Copyright 2008, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ --> @@ -21,15 +21,15 @@ package="com.android.googlesearch" android:sharedUserId="android.uid.shared"> - <application + <application android:process="android.process.acore" - android:label="Google Search"> - + android:label="@string/search_label"> + <activity android:name=".GoogleSearch" android:theme="@android:style/Theme.NoDisplay" android:excludeFromRecents="true"> <intent-filter> - <action android:name="android.intent.action.SEARCH" /> + <action android:name="android.intent.action.WEB_SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <!-- This must be lower than the default priority (0), so that it diff --git a/src/com/android/googlesearch/GoogleSearch.java b/src/com/android/googlesearch/GoogleSearch.java index 63a870d..cab6428 100644 --- a/src/com/android/googlesearch/GoogleSearch.java +++ b/src/com/android/googlesearch/GoogleSearch.java @@ -28,12 +28,12 @@ import android.text.TextUtils; * the global {@link Intent#ACTION_WEB_SEARCH}. */ public class GoogleSearch extends Activity { - + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); - if ((intent != null) && Intent.ACTION_SEARCH.equals(intent.getAction())) { + if ((intent != null) && Intent.ACTION_WEB_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); if (!TextUtils.isEmpty(query)) { // forward query to browser for Google search |