Commit cf5112a6 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android WebAPK Refactor] Rename WebappInfo#apkPackageName()

This CL renames WebappInfo#apkPackageName() to
WebappInfo#webApkPackageName(). The method name no longer needs to be
generic because TWAs no longer use WebappInfo.

Change-Id: I50d29053e28c42380681549ba8d9f8243b011c1e
Reviewed-on: https://chromium-review.googlesource.com/c/1351449Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611140}
parent 02baf9a4
......@@ -738,7 +738,7 @@ public class ShortcutHelper {
if (webApkInfo != null) {
names.add(webApkInfo.name());
shortNames.add(webApkInfo.shortName());
packageNames.add(webApkInfo.apkPackageName());
packageNames.add(webApkInfo.webApkPackageName());
shellApkVersions.add(webApkInfo.shellApkVersion());
versionCodes.add(packageInfo.versionCode);
uris.add(webApkInfo.uri().toString());
......
......@@ -87,7 +87,7 @@ public class WebApkActivity extends WebappActivity {
@Override
public String getNativeClientPackageName() {
return getWebappInfo().apkPackageName();
return getWebappInfo().webApkPackageName();
}
@Override
......
......@@ -311,7 +311,7 @@ public class WebApkInfo extends WebappInfo {
}
@Override
public String apkPackageName() {
public String webApkPackageName() {
return mApkPackageName;
}
......@@ -346,7 +346,7 @@ public class WebApkInfo extends WebappInfo {
intent.putExtra(ShortcutHelper.EXTRA_ID, id());
intent.putExtra(ShortcutHelper.EXTRA_URL, uri().toString());
intent.putExtra(ShortcutHelper.EXTRA_SOURCE, source());
intent.putExtra(WebApkConstants.EXTRA_WEBAPK_PACKAGE_NAME, apkPackageName());
intent.putExtra(WebApkConstants.EXTRA_WEBAPK_PACKAGE_NAME, webApkPackageName());
intent.putExtra(ShortcutHelper.EXTRA_FORCE_NAVIGATION, shouldForceNavigation());
}
......
......@@ -118,7 +118,7 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver {
WebApkInfo info = WebApkInfo.create(mOldInfo.id(), mOldInfo.uri().toString(), scopeUrl,
new WebApkInfo.Icon(primaryIconBitmap), new WebApkInfo.Icon(badgeIconBitmap), null,
name, shortName, displayMode, orientation, mOldInfo.source(), themeColor,
backgroundColor, mOldInfo.apkPackageName(), mOldInfo.shellApkVersion(),
backgroundColor, mOldInfo.webApkPackageName(), mOldInfo.shellApkVersion(),
mOldInfo.manifestUrl(), manifestStartUrl, WebApkInfo.WebApkDistributor.BROWSER,
iconUrlToMurmur2HashMap, serializedShareTarget, mOldInfo.shouldForceNavigation(),
mOldInfo.useTransparentSplash());
......
......@@ -246,7 +246,7 @@ public class WebApkUpdateManager implements WebApkUpdateDataFetcher.Observer {
return true;
}
if (!info.apkPackageName().startsWith(WEBAPK_PACKAGE_PREFIX)) return false;
if (!info.webApkPackageName().startsWith(WEBAPK_PACKAGE_PREFIX)) return false;
if (isShellApkVersionOutOfDate(info)
&& WebApkVersion.REQUEST_UPDATE_FOR_SHELL_APK_VERSION
......@@ -353,7 +353,7 @@ public class WebApkUpdateManager implements WebApkUpdateDataFetcher.Observer {
protected void storeWebApkUpdateRequestToFile(String updateRequestPath, WebApkInfo info,
String primaryIconUrl, String badgeIconUrl, boolean isManifestStale,
@WebApkUpdateReason int updateReason, Callback<Boolean> callback) {
int versionCode = readVersionCodeFromAndroidManifest(info.apkPackageName());
int versionCode = readVersionCodeFromAndroidManifest(info.webApkPackageName());
int size = info.iconUrlToMurmur2HashMap().size();
String[] iconUrls = new String[size];
String[] iconHashes = new String[size];
......@@ -369,7 +369,7 @@ public class WebApkUpdateManager implements WebApkUpdateDataFetcher.Observer {
info.scopeUri().toString(), info.name(), info.shortName(), primaryIconUrl,
info.icon(), badgeIconUrl, info.badgeIcon(), iconUrls, iconHashes,
info.displayMode(), info.orientation(), info.themeColor(), info.backgroundColor(),
info.manifestUrl(), info.apkPackageName(), versionCode, isManifestStale,
info.manifestUrl(), info.webApkPackageName(), versionCode, isManifestStale,
updateReason, callback);
}
......
......@@ -42,7 +42,7 @@ public class WebappDelegateFactory extends TabDelegateFactory {
// compatibility we relaunch it the hard way.
String startUrl = mActivity.getWebappInfo().uri().toString();
String webApkPackageName = mActivity.getWebappInfo().apkPackageName();
String webApkPackageName = mActivity.getWebappInfo().webApkPackageName();
if (!TextUtils.isEmpty(webApkPackageName)) {
Intent intent = WebApkNavigationClient.createLaunchWebApkIntent(
webApkPackageName, startUrl, false /* forceNavigation */);
......
......@@ -274,7 +274,7 @@ public class WebappInfo {
return mDisplayMode;
}
public String apkPackageName() {
public String webApkPackageName() {
return null;
}
......
......@@ -137,7 +137,7 @@ public class WebApkInfoTest {
Assert.assertEquals(1L, info.themeColor());
Assert.assertTrue(info.hasValidBackgroundColor());
Assert.assertEquals(2L, info.backgroundColor());
Assert.assertEquals(WEBAPK_PACKAGE_NAME, info.apkPackageName());
Assert.assertEquals(WEBAPK_PACKAGE_NAME, info.webApkPackageName());
Assert.assertEquals(SHELL_APK_VERSION, info.shellApkVersion());
Assert.assertEquals(MANIFEST_URL, info.manifestUrl());
Assert.assertEquals(START_URL, info.manifestStartUrl());
......
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