Bug 1533365 - On tablets the icon from Sync page its not displayed correctly; r=petru
authordiana.iacos <diana.iacos@softvision.ro>
Tue, 21 May 2019 08:20:55 +0000
changeset 474690 9bcf8d6124584b76919e7c1018427e96d47029d1
parent 474689 754426d70d2870cc8cdb4814f547b4e476648ff9
child 474691 06c314174286c2dbca838812e38c2fb8b04bc142
push id36044
push userrmaries@mozilla.com
push dateTue, 21 May 2019 15:45:34 +0000
treeherdermozilla-central@78571bb1f20e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspetru
bugs1533365
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533365 - On tablets the icon from Sync page its not displayed correctly; r=petru Differential Revision: https://phabricator.services.mozilla.com/D31963
mobile/android/base/java/org/mozilla/gecko/AboutPages.java
mobile/android/base/java/org/mozilla/gecko/icons/preparation/AboutPagesPreparer.java
--- a/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
@@ -82,16 +82,17 @@ public class AboutPages {
     }
 
     public static final List<String> DEFAULT_ICON_PAGES = Collections.unmodifiableList(Arrays.asList(
             HOME,
             ACCOUNTS,
             ADDONS,
             CONFIG,
             DOWNLOADS,
+            LOGINS,
             FIREFOX
     ));
 
     public static boolean isBuiltinIconPage(final String url) {
         if (url == null ||
             !url.startsWith("about:")) {
             return false;
         }
--- a/mobile/android/base/java/org/mozilla/gecko/icons/preparation/AboutPagesPreparer.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/preparation/AboutPagesPreparer.java
@@ -5,33 +5,37 @@
 
 package org.mozilla.gecko.icons.preparation;
 
 import org.mozilla.gecko.AboutPages;
 import org.mozilla.gecko.icons.IconDescriptor;
 import org.mozilla.gecko.icons.IconRequest;
 import org.mozilla.gecko.util.GeckoJarReader;
 
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
 /**
  * Preparer implementation for adding the omni.ja URL for internal about: pages.
  */
 public class AboutPagesPreparer implements Preparer {
     private Set<String> aboutUrls;
 
     public AboutPagesPreparer() {
         aboutUrls = new HashSet<>(AboutPages.DEFAULT_ICON_PAGES);
     }
 
     @Override
     public void prepare(IconRequest request) {
-        if (aboutUrls.contains(request.getPageUrl())) {
-            final String iconUrl = GeckoJarReader.getJarURL(request.getContext(), "chrome/geckoview/content/branding/favicon64.png");
+        final String requestPageUrl = request.getPageUrl();
+        if (requestPageUrl != null) {
+            for (String aboutUrl : aboutUrls) {
+                if (requestPageUrl.startsWith(aboutUrl)) {
+                    final String iconUrl = GeckoJarReader.getJarURL(request.getContext(), "chrome/geckoview/content/branding/favicon64.png");
 
-            request.modify()
-                    .icon(IconDescriptor.createLookupIcon(iconUrl))
-                    .deferBuild();
+                    request.modify()
+                            .icon(IconDescriptor.createLookupIcon(iconUrl))
+                            .deferBuild();
+                }
+            }
         }
     }
 }