Bug 1548000 - Default browser triggers "Default apps" screen; r=VladBaicu a=pascalc
authorAndrei Teslovan <andrei.teslovan@softvision.ro>
Sat, 04 May 2019 02:32:24 +0300
changeset 526484 d6c5478f35e9cc7d184772959017bef94854f72f
parent 526483 ea86833ccce9c01ee09b4377556ae58c68508141
child 526485 06f7ac4473b0c5f0e34a784e3f61d174f802a358
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu, pascalc
bugs1548000
milestone67.0
Bug 1548000 - Default browser triggers "Default apps" screen; r=VladBaicu a=pascalc
mobile/android/base/java/org/mozilla/gecko/preferences/DefaultBrowserPreference.java
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/DefaultBrowserPreference.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/DefaultBrowserPreference.java
@@ -7,43 +7,36 @@ package org.mozilla.gecko.preferences;
 
 import android.content.Context;
 import android.content.Intent;
 import android.util.AttributeSet;
 import android.widget.Toast;
 
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.R;
-import org.mozilla.gecko.util.PackageUtil;
 
 public class DefaultBrowserPreference extends LinkPreference {
 
     public DefaultBrowserPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
 
     public DefaultBrowserPreference(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
     }
 
     @Override
     protected void onClick() {
         if (GeckoPreferences.PREFS_DEFAULT_BROWSER.equals(getKey()) && AppConstants.Versions.feature24Plus) {
-            if (PackageUtil.isNoDefaultBrowserSet(this.getContext())) {
-                // the user don't have setup a default browser
-                PackageUtil.showInstalledBrowsers(this.getContext());
+            Toast.makeText(this.getContext(),
+                    this.getContext().getString(R.string.default_browser_system_settings_toast),
+                    Toast.LENGTH_LONG).show();
 
-            } else if (!PackageUtil.isDefaultBrowser(this.getContext())) {
-                Toast.makeText(this.getContext(),
-                        this.getContext().getString(R.string.default_browser_system_settings_toast),
-                        Toast.LENGTH_LONG).show();
-
-                // We are special casing the link to set the default browser here: On old Android versions we
-                // link to a SUMO page but on new Android versions we can link to the default app settings where
-                // the user can actually set a default browser (Bug 1312686).
-                Intent changeDefaultApps = new Intent("android.settings.MANAGE_DEFAULT_APPS_SETTINGS");
-                getContext().startActivity(changeDefaultApps);
-            }
+            // We are special casing the link to set the default browser here: On old Android versions we
+            // link to a SUMO page but on new Android versions we can link to the default app settings where
+            // the user can actually set a default browser (Bug 1312686).
+            Intent changeDefaultApps = new Intent("android.settings.MANAGE_DEFAULT_APPS_SETTINGS");
+            getContext().startActivity(changeDefaultApps);
         } else {
             super.onClick();
         }
     }
 }