New issue
Advanced search Search tips

Issue 910232 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 28
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 862041



Sign in to add a comment

Correct splashscreen for maskable icons

Project Member Reported by peconn@chromium.org, Nov 29

Issue description

Although Add To Home Screen shortcuts can use maskable icons, the splashscreen shown is not aware of this, see attached video.
 
2018-11-29_18-14-30-LaunchMaskable.mp4
1.5 MB View Download
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5b4ff5552afe127eb3fe0962d68a10ae50592526

commit 5b4ff5552afe127eb3fe0962d68a10ae50592526
Author: Peter E Conn <peconn@chromium.org>
Date: Fri Dec 28 09:31:27 2018

👹 Add whether the icon was adaptive to shortcut Intent.

When a Webapp is added as a homescreen shortcut the icon used is stored
in the shortcut launch Intent and may be used in the splash screen. When
a Webapp specifies a maskable icon in its manifest [1], the shortcut is
added as an Android Adaptive Icon [2].

We add whether the icon was adaptive or not to the Intent so that the
splashscreen can display it in the same way as it is shown on the
homescreen.

We cannot store the Adaptive Icon on the Intent as a Parcelable because
shortcut Intent extras are restricted to primitive types [3]. We don't
write the Icon back to a Bitmap because that changes the size of the
image, and preserving the size would mean scaling the image.

(I also took the opportunity to correct adaptable -> adaptive and
standardise variable names).

[1]: https://www.w3.org/TR/appmanifest/#purpose-member
[2]: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
[3]: https://developer.android.com/reference/android/content/pm/ShortcutInfo.Builder.html#setIntent(android.content.Intent)

Bug:  910232 
Change-Id: I22931ffc01065bd533f85a6d0dc875758fb23d1a
Reviewed-on: https://chromium-review.googlesource.com/c/1375723
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619134}
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappSplashScreenController.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/splash/SplashLayout.java
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/webapk/shell_apk/current_version/current_version.gni
[modify] https://crrev.com/5b4ff5552afe127eb3fe0962d68a10ae50592526/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/h2o/SplashActivity.java

Labels: Merge-Request-72
Status: Fixed (was: Assigned)
Project Member

Comment 3 by sheriffbot@chromium.org, Dec 28

Labels: -Merge-Request-72 Merge-Review-72 Hotlist-Merge-Review
This bug requires manual review: M72 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: govind@(Android), kariahda@(iOS), djmm@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Pls update bug with canary result and justify merge to M72. Thank you.
It doesn't seem to break anything on Canary.

It's part of a bigger fix that has already landed - https://bugs.chromium.org/p/chromium/issues/detail?id=904354 . It would be nice to have them in together.
Labels: -Merge-Review-72 Merge-Approved-72
Approving merge to M72 branch 3626 based on comment #5. Please merge ASAP. Thank you.
Pls merge your change to M72 branch 3626 ASAP so we can pick it up for next Beta release. Thank you.
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 4

Labels: -merge-approved-72 merge-merged-3626
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5d4d4ece36c8033b62129f61f5d852479ab58d7a

commit 5d4d4ece36c8033b62129f61f5d852479ab58d7a
Author: Peter E Conn <peconn@chromium.org>
Date: Fri Jan 04 16:46:56 2019

👹 Add whether the icon was adaptive to shortcut Intent.

When a Webapp is added as a homescreen shortcut the icon used is stored
in the shortcut launch Intent and may be used in the splash screen. When
a Webapp specifies a maskable icon in its manifest [1], the shortcut is
added as an Android Adaptive Icon [2].

We add whether the icon was adaptive or not to the Intent so that the
splashscreen can display it in the same way as it is shown on the
homescreen.

We cannot store the Adaptive Icon on the Intent as a Parcelable because
shortcut Intent extras are restricted to primitive types [3]. We don't
write the Icon back to a Bitmap because that changes the size of the
image, and preserving the size would mean scaling the image.

(I also took the opportunity to correct adaptable -> adaptive and
standardise variable names).

[1]: https://www.w3.org/TR/appmanifest/#purpose-member
[2]: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
[3]: https://developer.android.com/reference/android/content/pm/ShortcutInfo.Builder.html#setIntent(android.content.Intent)

Bug:  910232 
Change-Id: I22931ffc01065bd533f85a6d0dc875758fb23d1a
Reviewed-on: https://chromium-review.googlesource.com/c/1375723
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619134}

TBR pkotwicz@chromium.org, dominickn@chromium.org

Change-Id: I22931ffc01065bd533f85a6d0dc875758fb23d1a
Reviewed-on: https://chromium-review.googlesource.com/c/1396301
Reviewed-by: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/branch-heads/3626@{#561}
Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437}
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappSplashScreenController.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/splash/SplashLayout.java
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/webapk/shell_apk/current_version/current_version.gni
[modify] https://crrev.com/5d4d4ece36c8033b62129f61f5d852479ab58d7a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/h2o/SplashActivity.java

Labels: Merge-Merged-72-3626
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/5d4d4ece36c8033b62129f61f5d852479ab58d7a

Commit: 5d4d4ece36c8033b62129f61f5d852479ab58d7a
Author: peconn@chromium.org
Commiter: peconn@chromium.org
Date: 2019-01-04 16:46:56 +0000 UTC

👹 Add whether the icon was adaptive to shortcut Intent.

When a Webapp is added as a homescreen shortcut the icon used is stored
in the shortcut launch Intent and may be used in the splash screen. When
a Webapp specifies a maskable icon in its manifest [1], the shortcut is
added as an Android Adaptive Icon [2].

We add whether the icon was adaptive or not to the Intent so that the
splashscreen can display it in the same way as it is shown on the
homescreen.

We cannot store the Adaptive Icon on the Intent as a Parcelable because
shortcut Intent extras are restricted to primitive types [3]. We don't
write the Icon back to a Bitmap because that changes the size of the
image, and preserving the size would mean scaling the image.

(I also took the opportunity to correct adaptable -> adaptive and
standardise variable names).

[1]: https://www.w3.org/TR/appmanifest/#purpose-member
[2]: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
[3]: https://developer.android.com/reference/android/content/pm/ShortcutInfo.Builder.html#setIntent(android.content.Intent)

Bug:  910232 
Change-Id: I22931ffc01065bd533f85a6d0dc875758fb23d1a
Reviewed-on: https://chromium-review.googlesource.com/c/1375723
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619134}

TBR pkotwicz@chromium.org, dominickn@chromium.org

Change-Id: I22931ffc01065bd533f85a6d0dc875758fb23d1a
Reviewed-on: https://chromium-review.googlesource.com/c/1396301
Reviewed-by: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/branch-heads/3626@{#561}
Cr-Branched-From: d897fb137fbaaa9355c0c93124cc048824eb1e65-refs/heads/master@{#612437}

Sign in to add a comment