Commit 89514763 authored by Henry Jian's avatar Henry Jian Committed by Commit Bot

Modify shell apk for WebAPK to integrate adaptive icon

Before this CL, we had a non-standard res structure for
1. showing larger splash screen icons, and
2. allowing unsigned WebAPK API to have control over
   their use of adaptive icons.

After this CL, the res folder structure will be changed
to integrate adaptive icon.

Bug: 977173
Change-Id: Ib3deb834e0118db1d0c7f03428724427bdc058e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715100
Commit-Queue: Henry Jian <hzjian@google.com>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693804}
parent ea85a411
...@@ -358,6 +358,13 @@ Still reading? ...@@ -358,6 +358,13 @@ Still reading?
not use R.style.SplashTheme but new-style WebAPKs do. not use R.style.SplashTheme but new-style WebAPKs do.
TODO(crbug.com/971254): Remove suppression once old-style WebAPKs are deprecated. --> TODO(crbug.com/971254): Remove suppression once old-style WebAPKs are deprecated. -->
<ignore regexp="The resource `R.style.SplashTheme` appears to be unused"/> <ignore regexp="The resource `R.style.SplashTheme` appears to be unused"/>
<!-- The WAM server currently has 2 codes paths for minting a WebAPK, and
it needs these "unused" resources.
TODO(crbug.com/1001115): Remove suppression once 2 code paths are merged -->
<ignore regexp="The resource `R.mipmap.ic_launcher_background` appears to be unused"/>
<ignore regexp="The resource `R.mipmap.ic_launcher_foreground` appears to be unused"/>
<ignore regexp="The resource `R.mipmap.maskable_splash_icon_xxhdpi` appears to be unused"/>
<ignore regexp="The resource `R.mipmap.maskable_splash_icon_xxxhdpi` appears to be unused"/>
<!-- Endnote: Please specify number of suppressions when adding more --> <!-- Endnote: Please specify number of suppressions when adding more -->
</issue> </issue>
<issue id="UseCompoundDrawables"> <issue id="UseCompoundDrawables">
......
...@@ -28,6 +28,11 @@ public class WebApkExtras { ...@@ -28,6 +28,11 @@ public class WebApkExtras {
*/ */
public final WebappIcon splashIcon; public final WebappIcon splashIcon;
/**
* Whether the WebAPK's splash icon should be masked.
*/
public final boolean isSplashIconMaskable;
/** /**
* Version of the code in //chrome/android/webapk/shell_apk. * Version of the code in //chrome/android/webapk/shell_apk.
*/ */
...@@ -85,20 +90,23 @@ public class WebApkExtras { ...@@ -85,20 +90,23 @@ public class WebApkExtras {
public static WebApkExtras createEmpty() { public static WebApkExtras createEmpty() {
return new WebApkExtras(null /* webApkPackageName */, new WebappIcon(), new WebappIcon(), return new WebApkExtras(null /* webApkPackageName */, new WebappIcon(), new WebappIcon(),
0 /* shellApkVersion */, null /* manifestUrl */, null /* manifestStartUrl */, false /* isSplashIconMaskable */, 0 /* shellApkVersion */, null /* manifestUrl */,
WebApkDistributor.OTHER, null /* iconUrlToMurmur2HashMap */, new ShareTarget(), null /* manifestStartUrl */, WebApkDistributor.OTHER,
null /* iconUrlToMurmur2HashMap */, new ShareTarget(),
null /* shareTargetActivityName */, false /* isSplashProvidedByWebApk */, null /* shareTargetActivityName */, false /* isSplashProvidedByWebApk */,
null /* shareData */, 0 /* webApkVersionCode */); null /* shareData */, 0 /* webApkVersionCode */);
} }
public WebApkExtras(String webApkPackageName, WebappIcon badgeIcon, WebappIcon splashIcon, public WebApkExtras(String webApkPackageName, WebappIcon badgeIcon, WebappIcon splashIcon,
int shellApkVersion, String manifestUrl, String manifestStartUrl, boolean isSplashIconMaskable, int shellApkVersion, String manifestUrl,
@WebApkDistributor int distributor, Map<String, String> iconUrlToMurmur2HashMap, String manifestStartUrl, @WebApkDistributor int distributor,
ShareTarget shareTarget, String shareTargetActivityName, Map<String, String> iconUrlToMurmur2HashMap, ShareTarget shareTarget,
boolean isSplashProvidedByWebApk, ShareData shareData, int webApkVersionCode) { String shareTargetActivityName, boolean isSplashProvidedByWebApk, ShareData shareData,
int webApkVersionCode) {
this.webApkPackageName = webApkPackageName; this.webApkPackageName = webApkPackageName;
this.badgeIcon = badgeIcon; this.badgeIcon = badgeIcon;
this.splashIcon = splashIcon; this.splashIcon = splashIcon;
this.isSplashIconMaskable = isSplashIconMaskable;
this.shellApkVersion = shellApkVersion; this.shellApkVersion = shellApkVersion;
this.manifestUrl = manifestUrl; this.manifestUrl = manifestUrl;
this.manifestStartUrl = manifestStartUrl; this.manifestStartUrl = manifestStartUrl;
......
...@@ -181,17 +181,18 @@ public class WebApkInfo extends WebappInfo { ...@@ -181,17 +181,18 @@ public class WebApkInfo extends WebappInfo {
WebappIcon badgeIcon, WebappIcon splashIcon, String name, String shortName, WebappIcon badgeIcon, WebappIcon splashIcon, String name, String shortName,
@WebDisplayMode int displayMode, int orientation, int source, long themeColor, @WebDisplayMode int displayMode, int orientation, int source, long themeColor,
long backgroundColor, int defaultBackgroundColor, boolean isPrimaryIconMaskable, long backgroundColor, int defaultBackgroundColor, boolean isPrimaryIconMaskable,
String webApkPackageName, int shellApkVersion, String manifestUrl, boolean isSplashIconMaskable, String webApkPackageName, int shellApkVersion,
String manifestStartUrl, @WebApkDistributor int distributor, String manifestUrl, String manifestStartUrl, @WebApkDistributor int distributor,
Map<String, String> iconUrlToMurmur2HashMap, ShareTarget shareTarget, Map<String, String> iconUrlToMurmur2HashMap, ShareTarget shareTarget,
String shareTargetActivityName, boolean forceNavigation, String shareTargetActivityName, boolean forceNavigation,
boolean isSplashProvidedByWebApk, ShareData shareData, int webApkVersionCode) { boolean isSplashProvidedByWebApk, ShareData shareData, int webApkVersionCode) {
return create(WebApkIntentDataProvider.create(url, scope, primaryIcon, badgeIcon, return create(WebApkIntentDataProvider.create(url, scope, primaryIcon, badgeIcon,
splashIcon, name, shortName, displayMode, orientation, source, themeColor, splashIcon, name, shortName, displayMode, orientation, source, themeColor,
backgroundColor, defaultBackgroundColor, isPrimaryIconMaskable, webApkPackageName, backgroundColor, defaultBackgroundColor, isPrimaryIconMaskable,
shellApkVersion, manifestUrl, manifestStartUrl, distributor, isSplashIconMaskable, webApkPackageName, shellApkVersion, manifestUrl,
iconUrlToMurmur2HashMap, shareTarget, shareTargetActivityName, forceNavigation, manifestStartUrl, distributor, iconUrlToMurmur2HashMap, shareTarget,
isSplashProvidedByWebApk, shareData, webApkVersionCode)); shareTargetActivityName, forceNavigation, isSplashProvidedByWebApk, shareData,
webApkVersionCode));
} }
private static WebApkInfo create(@Nullable BrowserServicesIntentDataProvider provider) { private static WebApkInfo create(@Nullable BrowserServicesIntentDataProvider provider) {
...@@ -216,6 +217,10 @@ public class WebApkInfo extends WebappInfo { ...@@ -216,6 +217,10 @@ public class WebApkInfo extends WebappInfo {
return getWebApkExtras().splashIcon; return getWebApkExtras().splashIcon;
} }
public boolean isSplashIconMaskable() {
return getWebApkExtras().isSplashIconMaskable;
}
/** Returns data about the WebAPK's share intent handlers. */ /** Returns data about the WebAPK's share intent handlers. */
public ShareTarget shareTarget() { public ShareTarget shareTarget() {
return getWebApkExtras().shareTarget; return getWebApkExtras().shareTarget;
......
...@@ -219,12 +219,25 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider ...@@ -219,12 +219,25 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider
int distributor = getDistributor(bundle, webApkPackageName); int distributor = getDistributor(bundle, webApkPackageName);
int primaryIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.ICON_ID, 0); int primaryIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.ICON_ID, 0);
int primaryMaskableIconId =
IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.MASKABLE_ICON_ID, 0);
boolean isPrimaryIconMaskable = boolean isPrimaryIconMaskable =
IntentUtils.safeGetBoolean(bundle, WebApkMetaDataKeys.IS_ICON_MASKABLE, false); primaryMaskableIconId != 0 && ShortcutHelper.doesAndroidSupportMaskableIcons();
int badgeIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.BADGE_ICON_ID, 0); int badgeIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.BADGE_ICON_ID, 0);
int splashIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.SPLASH_ID, 0); int splashIconId = IntentUtils.safeGetInt(bundle, WebApkMetaDataKeys.SPLASH_ID, 0);
int isSplashIconMaskableBooleanId = IntentUtils.safeGetInt(
bundle, WebApkMetaDataKeys.IS_SPLASH_ICON_MASKABLE_BOOLEAN_ID, 0);
boolean isSplashIconMaskable = false;
if (isSplashIconMaskableBooleanId != 0) {
try {
isSplashIconMaskable = res.getBoolean(isSplashIconMaskableBooleanId);
} catch (Resources.NotFoundException e) {
}
}
Pair<String, ShareTarget> shareTargetActivityNameAndData = Pair<String, ShareTarget> shareTargetActivityNameAndData =
extractFirstShareTarget(webApkPackageName); extractFirstShareTarget(webApkPackageName);
String shareTargetActivityName = shareTargetActivityNameAndData.first; String shareTargetActivityName = shareTargetActivityNameAndData.first;
...@@ -234,12 +247,14 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider ...@@ -234,12 +247,14 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider
(canUseSplashFromContentProvider && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N (canUseSplashFromContentProvider && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
&& hasContentProviderForSplash(webApkPackageName)); && hasContentProviderForSplash(webApkPackageName));
return create(url, scope, new WebappIcon(webApkPackageName, primaryIconId), return create(url, scope,
new WebappIcon(webApkPackageName,
isPrimaryIconMaskable ? primaryMaskableIconId : primaryIconId),
new WebappIcon(webApkPackageName, badgeIconId), new WebappIcon(webApkPackageName, badgeIconId),
new WebappIcon(webApkPackageName, splashIconId), name, shortName, displayMode, new WebappIcon(webApkPackageName, splashIconId), name, shortName, displayMode,
orientation, source, themeColor, backgroundColor, defaultBackgroundColor, orientation, source, themeColor, backgroundColor, defaultBackgroundColor,
isPrimaryIconMaskable, webApkPackageName, shellApkVersion, manifestUrl, isPrimaryIconMaskable, isSplashIconMaskable, webApkPackageName, shellApkVersion,
manifestStartUrl, distributor, iconUrlToMurmur2HashMap, shareTarget, manifestUrl, manifestStartUrl, distributor, iconUrlToMurmur2HashMap, shareTarget,
shareTargetActivityName, forceNavigation, isSplashProvidedByWebApk, shareData, shareTargetActivityName, forceNavigation, isSplashProvidedByWebApk, shareData,
apkVersion); apkVersion);
} }
...@@ -261,6 +276,7 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider ...@@ -261,6 +276,7 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider
* @param defaultBackgroundColor The background color to use if the Web Manifest does not * @param defaultBackgroundColor The background color to use if the Web Manifest does not
* provide a background color. * provide a background color.
* @param isPrimaryIconMaskable Is the primary icon maskable. * @param isPrimaryIconMaskable Is the primary icon maskable.
* @param isSplashIconMaskable Is the splash icon maskable.
* @param webApkPackageName The package of the WebAPK. * @param webApkPackageName The package of the WebAPK.
* @param shellApkVersion Version of the code in //chrome/android/webapk/shell_apk. * @param shellApkVersion Version of the code in //chrome/android/webapk/shell_apk.
* @param manifestUrl URL of the Web Manifest. * @param manifestUrl URL of the Web Manifest.
...@@ -285,8 +301,8 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider ...@@ -285,8 +301,8 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider
WebappIcon badgeIcon, WebappIcon splashIcon, String name, String shortName, WebappIcon badgeIcon, WebappIcon splashIcon, String name, String shortName,
@WebDisplayMode int displayMode, int orientation, int source, long themeColor, @WebDisplayMode int displayMode, int orientation, int source, long themeColor,
long backgroundColor, int defaultBackgroundColor, boolean isPrimaryIconMaskable, long backgroundColor, int defaultBackgroundColor, boolean isPrimaryIconMaskable,
String webApkPackageName, int shellApkVersion, String manifestUrl, boolean isSplashIconMaskable, String webApkPackageName, int shellApkVersion,
String manifestStartUrl, @WebApkDistributor int distributor, String manifestUrl, String manifestStartUrl, @WebApkDistributor int distributor,
Map<String, String> iconUrlToMurmur2HashMap, ShareTarget shareTarget, Map<String, String> iconUrlToMurmur2HashMap, ShareTarget shareTarget,
String shareTargetActivityName, boolean forceNavigation, String shareTargetActivityName, boolean forceNavigation,
boolean isSplashProvidedByWebApk, ShareData shareData, int webApkVersionCode) { boolean isSplashProvidedByWebApk, ShareData shareData, int webApkVersionCode) {
...@@ -328,7 +344,7 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider ...@@ -328,7 +344,7 @@ public class WebApkIntentDataProvider extends BrowserServicesIntentDataProvider
defaultBackgroundColor, false /* isIconGenerated */, isPrimaryIconMaskable, defaultBackgroundColor, false /* isIconGenerated */, isPrimaryIconMaskable,
forceNavigation); forceNavigation);
WebApkExtras webApkExtras = new WebApkExtras(webApkPackageName, badgeIcon, splashIcon, WebApkExtras webApkExtras = new WebApkExtras(webApkPackageName, badgeIcon, splashIcon,
shellApkVersion, manifestUrl, manifestStartUrl, distributor, isSplashIconMaskable, shellApkVersion, manifestUrl, manifestStartUrl, distributor,
iconUrlToMurmur2HashMap, shareTarget, shareTargetActivityName, iconUrlToMurmur2HashMap, shareTarget, shareTargetActivityName,
isSplashProvidedByWebApk, shareData, webApkVersionCode); isSplashProvidedByWebApk, shareData, webApkVersionCode);
return new WebApkIntentDataProvider(webappExtras, webApkExtras); return new WebApkIntentDataProvider(webappExtras, webApkExtras);
......
...@@ -130,10 +130,10 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver { ...@@ -130,10 +130,10 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver {
WebApkInfo info = WebApkInfo.create(mOldInfo.url(), scopeUrl, WebApkInfo info = WebApkInfo.create(mOldInfo.url(), scopeUrl,
new WebappIcon(primaryIconBitmap), new WebappIcon(badgeIconBitmap), null, name, new WebappIcon(primaryIconBitmap), new WebappIcon(badgeIconBitmap), null, name,
shortName, displayMode, orientation, mOldInfo.source(), themeColor, backgroundColor, shortName, displayMode, orientation, mOldInfo.source(), themeColor, backgroundColor,
defaultBackgroundColor, isPrimaryIconMaskable, mOldInfo.webApkPackageName(), defaultBackgroundColor, isPrimaryIconMaskable, false /* isSplashIconMaskable */,
mOldInfo.shellApkVersion(), mOldInfo.manifestUrl(), manifestStartUrl, mOldInfo.webApkPackageName(), mOldInfo.shellApkVersion(), mOldInfo.manifestUrl(),
WebApkDistributor.BROWSER, iconUrlToMurmur2HashMap, shareTarget, null, manifestStartUrl, WebApkDistributor.BROWSER, iconUrlToMurmur2HashMap, shareTarget,
mOldInfo.shouldForceNavigation(), mOldInfo.isSplashProvidedByWebApk(), null, null, mOldInfo.shouldForceNavigation(), mOldInfo.isSplashProvidedByWebApk(), null,
mOldInfo.webApkVersionCode()); mOldInfo.webApkVersionCode());
mObserver.onGotManifestData(info, primaryIconUrl, badgeIconUrl); mObserver.onGotManifestData(info, primaryIconUrl, badgeIconUrl);
} }
......
...@@ -83,36 +83,36 @@ public class WebappSplashDelegate implements SplashDelegate { ...@@ -83,36 +83,36 @@ public class WebappSplashDelegate implements SplashDelegate {
splashScreen.setBackgroundColor(backgroundColor); splashScreen.setBackgroundColor(backgroundColor);
if (mWebappInfo.isForWebApk()) { if (mWebappInfo.isForWebApk()) {
WebApkInfo webApkInfo = (WebApkInfo) mWebappInfo;
initializeWebApkInfoSplashLayout(splashScreen, backgroundColor, initializeWebApkInfoSplashLayout(splashScreen, backgroundColor,
((WebApkInfo) mWebappInfo).splashIcon().bitmap()); webApkInfo.splashIcon().bitmap(), webApkInfo.isSplashIconMaskable());
return splashScreen; return splashScreen;
} }
WebappDataStorage storage = WebappDataStorage storage =
WebappRegistry.getInstance().getWebappDataStorage(mWebappInfo.id()); WebappRegistry.getInstance().getWebappDataStorage(mWebappInfo.id());
if (storage == null) { if (storage == null) {
initializeWebApkInfoSplashLayout(splashScreen, backgroundColor, null); initializeWebApkInfoSplashLayout(splashScreen, backgroundColor, null, false);
return splashScreen; return splashScreen;
} }
storage.getSplashScreenImage(new WebappDataStorage.FetchCallback<Bitmap>() { storage.getSplashScreenImage(new WebappDataStorage.FetchCallback<Bitmap>() {
@Override @Override
public void onDataRetrieved(Bitmap splashImage) { public void onDataRetrieved(Bitmap splashImage) {
initializeWebApkInfoSplashLayout(splashScreen, backgroundColor, splashImage); initializeWebApkInfoSplashLayout(splashScreen, backgroundColor, splashImage, false);
} }
}); });
return splashScreen; return splashScreen;
} }
private void initializeWebApkInfoSplashLayout( private void initializeWebApkInfoSplashLayout(ViewGroup splashScreen, int backgroundColor,
ViewGroup splashScreen, int backgroundColor, Bitmap splashImage) { Bitmap splashImage, boolean isSplashIconMaskable) {
Context context = ContextUtils.getApplicationContext(); Context context = ContextUtils.getApplicationContext();
Resources resources = context.getResources(); Resources resources = context.getResources();
Bitmap selectedIcon = splashImage; Bitmap selectedIcon = splashImage;
boolean selectedIconGenerated = false; boolean selectedIconGenerated = false;
// TODO(crbug.com/977173): assign selectedIconAdaptive to correct value boolean selectedIconAdaptive = isSplashIconMaskable;
boolean selectedIconAdaptive = false;
if (selectedIcon == null) { if (selectedIcon == null) {
selectedIcon = mWebappInfo.icon().bitmap(); selectedIcon = mWebappInfo.icon().bitmap();
selectedIconGenerated = mWebappInfo.isIconGenerated(); selectedIconGenerated = mWebappInfo.isIconGenerated();
......
...@@ -158,10 +158,11 @@ public class WebApkUpdateManagerTest { ...@@ -158,10 +158,11 @@ public class WebApkUpdateManagerTest {
final TestWebApkUpdateManager updateManager = new TestWebApkUpdateManager(waiter, storage); final TestWebApkUpdateManager updateManager = new TestWebApkUpdateManager(waiter, storage);
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
WebApkInfo info = WebApkInfo.create("", creationData.scope, null, null, null, WebApkInfo info = WebApkInfo.create(
creationData.name, creationData.shortName, creationData.displayMode, "", creationData.scope, null, null, null, creationData.name,
creationData.orientation, 0, creationData.themeColor, creationData.shortName, creationData.displayMode, creationData.orientation, 0,
creationData.backgroundColor, 0, creationData.isPrimaryIconMaskable, "", creationData.themeColor, creationData.backgroundColor, 0,
creationData.isPrimaryIconMaskable, false /* isSplashIconMaskable */, "",
WebApkVersion.REQUEST_UPDATE_FOR_SHELL_APK_VERSION, creationData.manifestUrl, WebApkVersion.REQUEST_UPDATE_FOR_SHELL_APK_VERSION, creationData.manifestUrl,
creationData.startUrl, WebApkDistributor.BROWSER, creationData.startUrl, WebApkDistributor.BROWSER,
creationData.iconUrlToMurmur2HashMap, null, null /*shareTargetActivityName*/, creationData.iconUrlToMurmur2HashMap, null, null /*shareTargetActivityName*/,
......
...@@ -369,8 +369,9 @@ public class WebApkUpdateManagerUnitTest { ...@@ -369,8 +369,9 @@ public class WebApkUpdateManagerUnitTest {
null, manifestData.name, manifestData.shortName, manifestData.displayMode, null, manifestData.name, manifestData.shortName, manifestData.displayMode,
manifestData.orientation, -1, manifestData.themeColor, manifestData.backgroundColor, manifestData.orientation, -1, manifestData.themeColor, manifestData.backgroundColor,
manifestData.defaultBackgroundColor, false /* isPrimaryIconMaskable */, manifestData.defaultBackgroundColor, false /* isPrimaryIconMaskable */,
kPackageName, -1, WEB_MANIFEST_URL, manifestData.startUrl, false /* isSplashIconMaskable*/, kPackageName, -1, WEB_MANIFEST_URL,
WebApkDistributor.BROWSER, manifestData.iconUrlToMurmur2HashMap, manifestData.startUrl, WebApkDistributor.BROWSER,
manifestData.iconUrlToMurmur2HashMap,
new WebApkInfo.ShareTarget(manifestData.shareTargetAction, new WebApkInfo.ShareTarget(manifestData.shareTargetAction,
manifestData.shareTargetParamTitle, null, null, manifestData.shareTargetParamTitle, null, null,
manifestData.shareTargetMethod != null manifestData.shareTargetMethod != null
......
...@@ -25,8 +25,10 @@ public final class WebApkMetaDataKeys { ...@@ -25,8 +25,10 @@ public final class WebApkMetaDataKeys {
public static final String DEFAULT_BACKGROUND_COLOR_ID = public static final String DEFAULT_BACKGROUND_COLOR_ID =
"org.chromium.webapk.shell_apk.defaultBackgroundColorId"; "org.chromium.webapk.shell_apk.defaultBackgroundColorId";
public static final String ICON_ID = "org.chromium.webapk.shell_apk.iconId"; public static final String ICON_ID = "org.chromium.webapk.shell_apk.iconId";
public static final String IS_ICON_MASKABLE = "org.chromium.webapk.shell_apk.isIconMaskable"; public static final String MASKABLE_ICON_ID = "org.chromium.webapk.shell_apk.maskableIconId";
public static final String SPLASH_ID = "org.chromium.webapk.shell_apk.splashId"; public static final String SPLASH_ID = "org.chromium.webapk.shell_apk.splashId";
public static final String IS_SPLASH_ICON_MASKABLE_BOOLEAN_ID =
"org.chromium.webapk.shell_apk.isSplashIconMaskableBooleanId";
public static final String ICON_URLS_AND_ICON_MURMUR2_HASHES = public static final String ICON_URLS_AND_ICON_MURMUR2_HASHES =
"org.chromium.webapk.shell_apk.iconUrlsAndIconMurmur2Hashes"; "org.chromium.webapk.shell_apk.iconUrlsAndIconMurmur2Hashes";
......
...@@ -131,7 +131,9 @@ ...@@ -131,7 +131,9 @@
<meta-data android:name="org.chromium.webapk.shell_apk.defaultBackgroundColorId" android:resource="@color/webapp_default_bg" /> <meta-data android:name="org.chromium.webapk.shell_apk.defaultBackgroundColorId" android:resource="@color/webapp_default_bg" />
<meta-data android:name="org.chromium.webapk.shell_apk.iconId" android:resource="@mipmap/app_icon" /> <meta-data android:name="org.chromium.webapk.shell_apk.iconId" android:resource="@mipmap/app_icon" />
<meta-data android:name="org.chromium.webapk.shell_apk.maskableIconId" android:resource="@mipmap/maskable_app_icon"/>
<meta-data android:name="org.chromium.webapk.shell_apk.splashId" android:resource="@drawable/splash_icon" /> <meta-data android:name="org.chromium.webapk.shell_apk.splashId" android:resource="@drawable/splash_icon" />
<meta-data android:name="org.chromium.webapk.shell_apk.isSplashIconMaskableBooleanId" android:resource="@bool/is_splash_icon_maskable"/>
<meta-data android:name="org.chromium.webapk.shell_apk.distributor" android:value="{{{distributor}}}" /> <meta-data android:name="org.chromium.webapk.shell_apk.distributor" android:value="{{{distributor}}}" />
{{! Hashes of icons should be taken of the icons as they are available on the web. The icon {{! Hashes of icons should be taken of the icons as they are available on the web. The icon
......
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
# //chrome/android/webapk/shell_apk:webapk is changed. This includes # //chrome/android/webapk/shell_apk:webapk is changed. This includes
# Java files, Android resource files and AndroidManifest.xml. Does not affect # Java files, Android resource files and AndroidManifest.xml. Does not affect
# Chrome.apk # Chrome.apk
current_shell_apk_version = 104 current_shell_apk_version = 105
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
found in the LICENSE file. --> found in the LICENSE file. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/> <background android:drawable="@color/white_adaptive_ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/maskable_app_icon"/>
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/maskable_app_icon_hdpi"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/maskable_app_icon_mdpi"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/maskable_app_icon_xhdpi"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/maskable_app_icon_xxhdpi"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/maskable_app_icon_xxxhdpi"/>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<bool name="is_splash_icon_maskable">false</bool>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<bool name="is_splash_icon_maskable">false</bool>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<bool name="is_splash_icon_maskable">false</bool>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<bool name="is_splash_icon_maskable">false</bool>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<bool name="is_splash_icon_maskable">false</bool>
</resources>
...@@ -8,4 +8,5 @@ ...@@ -8,4 +8,5 @@
<color name="black_alpha_38">#61000000</color> <color name="black_alpha_38">#61000000</color>
<color name="black_alpha_54">#8A000000</color> <color name="black_alpha_54">#8A000000</color>
<color name="black_alpha_87">#DE000000</color> <color name="black_alpha_87">#DE000000</color>
<color name="white_adaptive_ic_launcher_background">#FFFFFF</color>
</resources> </resources>
...@@ -48,8 +48,9 @@ public class WebApkInfoBuilder { ...@@ -48,8 +48,9 @@ public class WebApkInfoBuilder {
ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN,
ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING,
ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, Color.WHITE, ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, Color.WHITE,
false /* isPrimaryIconMaskable */, mWebApkPackageName, /* shellApkVersion */ 1, false /* isPrimaryIconMaskable */, false /* isSplashIconMaskable */,
mManifestUrl, mUrl, WebApkDistributor.BROWSER, mWebApkPackageName, /* shellApkVersion */ 1, mManifestUrl, mUrl,
WebApkDistributor.BROWSER,
new HashMap<String, String>() /* iconUrlToMurmur2HashMap */, null, null, new HashMap<String, String>() /* iconUrlToMurmur2HashMap */, null, null,
false /* forceNavigation */, false /* isSplashProvidedByWebApk */, null, false /* forceNavigation */, false /* isSplashProvidedByWebApk */, null,
1 /* webApkVersionCode */); 1 /* webApkVersionCode */);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment