Bug 1360670 - Remove the PROCESS_TEXT intent from the search activity r?jhan draft
authorfriedger <friedger@gmail.com>
Tue, 02 May 2017 19:43:45 +0200
changeset 571469 e2f37f0794b9cebe6b658e96de96a49a8ae04d27
parent 571414 bfc7b187005cabbc828ed9f5b61daf139c3cfd90
child 571537 0d82a2f68145a94a32dd6d27f2e98389617ac6cf
push id56804
push userbmo:mail@friedger.de
push dateTue, 02 May 2017 17:44:26 +0000
reviewersjhan
bugs1360670
milestone55.0a1
Bug 1360670 - Remove the PROCESS_TEXT intent from the search activity r?jhan remove PROCESS_TEXT intent filter from search widget, remove related code. MozReview-Commit-ID: 9MGDwDASzWP
mobile/android/search/java/org/mozilla/search/SearchActivity.java
mobile/android/search/manifests/SearchAndroidManifest_activities.xml.in
--- a/mobile/android/search/java/org/mozilla/search/SearchActivity.java
+++ b/mobile/android/search/java/org/mozilla/search/SearchActivity.java
@@ -214,25 +214,17 @@ public class SearchActivity extends Loca
     }
 
     @Nullable
     private String extractQuery(Bundle bundle) {
         if (bundle == null) {
             return null;
         }
 
-        String queryString = (String) bundle.getCharSequence("android.intent.extra.PROCESS_TEXT_READONLY");;
-        if (TextUtils.isEmpty(queryString)) {
-            queryString = (String) bundle.getCharSequence("android.intent.extra.PROCESS_TEXT");
-        }
-        if (TextUtils.isEmpty(queryString)) {
-            queryString = bundle.getString(KEY_QUERY);
-        }
-
-        return queryString;
+        return bundle.getString(KEY_QUERY);
     }
 
     @Override
     protected void onDestroy() {
         super.onDestroy();
         searchEngineManager.unregisterListeners();
         engine = null;
         suggestionsFragment = null;
--- a/mobile/android/search/manifests/SearchAndroidManifest_activities.xml.in
+++ b/mobile/android/search/manifests/SearchAndroidManifest_activities.xml.in
@@ -12,21 +12,16 @@
                 <action android:name="android.intent.action.SEARCH"/>
                 <action android:name="android.intent.action.SEARCH_LONG_PRESS"/>
                 <action android:name="android.intent.action.WEB_SEARCH"/>
                 <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
 
                 <category android:name="android.intent.category.DEFAULT"/>
             </intent-filter>
 
-            <intent-filter>
-                <action android:name="android.intent.action.PROCESS_TEXT"/>
-                <data android:mimeType="text/plain"/>
-            </intent-filter>
-
             <!-- Pre Lollipop devices display a generic search icon, if none is
                  provided here. To use this we need to set the resource to 0.
                  For Lollipop and later the search launcher icon ist used.
                  To retrieve the resource value the Bundle.getInt() method is
                  used, so we use integer resources instead of drawables, because
                  setting a drawable referenced to 0 results in errors when used
                  as a real drawable resource somewhere else. -->
             <meta-data