Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Make the GoogleSearch provider understand action.WEB_SEARCH
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Satish Sampath committed Jun 2, 2009
1 parent f6c2f6a commit 40add5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions AndroidManifest.xml
Expand Up @@ -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.
*/
-->
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/com/android/googlesearch/GoogleSearch.java
Expand Up @@ -28,12 +28,12 @@
* 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
Expand Down

0 comments on commit 40add5d

Please sign in to comment.