Commit 0b8414c1 authored by clamy's avatar clamy Committed by Commit bot

Reland of [Android:WebAPK] Don't add webapp to homescreen if WebAPK install...

Reland of [Android:WebAPK] Don't add webapp to homescreen if WebAPK install times out part 2/3 (patchset #1 id:1 of https://codereview.chromium.org/2757563002/ )

Reason for revert:
The CL reverted was part of a two-sided CL, and the downstream part landed just before this got reverted. So the Android ToT roller bot is broken again. Let's land this CL again, so that everything goes back to green.

Original issue's description:
> Revert of [Android:WebAPK] Don't add webapp to homescreen if WebAPK install times out part 2/3 (patchset #2 id:20001 of https://codereview.chromium.org/2728053002/ )
>
> Reason for revert:
> This is causing build failures on clang-clankium-tot-builder
> See:
> https://crbug.com/702086
> https://uberchromegw.corp.google.com/i/internal.client.clank_tot/builders/clang-clankium-tot-builder/builds/43251
>
> Original issue's description:
> > [Android:WebAPK] Don't add webapp to homescreen if WebAPK install times out part 2/3
> >
> > This CL:
> > - Changes GooglePlayWebApkInstallDelegate#installAsync() to return a
> >   WebApkInstallResult in the callback.
> > - Deletes unused GooglePlayWebApkInstallDelegate#canInstallWebApk().
> >
> > BUG=696132
> >
> > Review-Url: https://codereview.chromium.org/2728053002
> > Cr-Commit-Position: refs/heads/master@{#457300}
> > Committed: https://chromium.googlesource.com/chromium/src/+/19d929ae378491116d7683764baa6365d1ddd50d
>
> TBR=dominickn@chromium.org,pkotwicz@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=696132
>
> Review-Url: https://codereview.chromium.org/2757563002
> Cr-Commit-Position: refs/heads/master@{#457361}
> Committed: https://chromium.googlesource.com/chromium/src/+/6da294d05e78dcdd1109ae8dc763ea0485c714af

TBR=dominickn@chromium.org,pkotwicz@chromium.org,aelias@chromium.org,cblume@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=696132

Review-Url: https://codereview.chromium.org/2757543003
Cr-Commit-Position: refs/heads/master@{#457402}
parent f35532b8
......@@ -38,10 +38,10 @@ public interface GooglePlayWebApkInstallDelegate {
* @param title The title of the WebAPK to display during installation.
* @param token The token from WebAPK Minter Server.
* @param url The start URL of the WebAPK to install.
* @param callback The callback to invoke when the install is either completed or failed.
* @param callback The callback to invoke when the install completes, times out or fails.
*/
void installAsync(String packageName, int version, String title, String token, String url,
Callback<Boolean> callback);
Callback<Integer> callback);
/**
* Calls the callback once the installation either succeeded or failed.
......@@ -49,10 +49,4 @@ public interface GooglePlayWebApkInstallDelegate {
* @param event The result of the install.
*/
void onGotInstallEvent(String packageName, @InstallerPackageEvent int event);
/**
* Checks whether Google Play Install API is available.
* @param callback The callback to invoke when the check is done.
*/
void canInstallWebApk(Callback<Boolean> callback);
}
......@@ -120,13 +120,10 @@ public class WebApkInstaller {
return;
}
Callback<Boolean> callback = new Callback<Boolean>() {
Callback<Integer> callback = new Callback<Integer>() {
@Override
public void onResult(Boolean success) {
// TODO(pkotwicz): Send WebApkInstallResult.PROBABLE_FAILURE result if
// install timed out.
WebApkInstaller.this.notify(
success ? WebApkInstallResult.SUCCESS : WebApkInstallResult.FAILURE);
public void onResult(Integer result) {
WebApkInstaller.this.notify(result);
}
};
mGooglePlayWebApkInstallDelegate.installAsync(
......@@ -180,13 +177,10 @@ public class WebApkInstaller {
return;
}
Callback<Boolean> callback = new Callback<Boolean>() {
Callback<Integer> callback = new Callback<Integer>() {
@Override
public void onResult(Boolean success) {
// TODO(pkotwicz): Send WebApkInstallResult.PROBABLE_FAILURE result if
// update timed out.
WebApkInstaller.this.notify(
success ? WebApkInstallResult.SUCCESS : WebApkInstallResult.FAILURE);
public void onResult(Integer result) {
WebApkInstaller.this.notify(result);
}
};
mGooglePlayWebApkInstallDelegate.installAsync(
......
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