Skip to content

Commit

Permalink
REMOTE: adjust to a protocol change: the purchase endpoint no longer …
Browse files Browse the repository at this point in the history
…provides the download urls, but still needs to be called to add the app to the list of deliverables
  • Loading branch information
onyxbits committed Sep 7, 2017
1 parent 416fb54 commit 0aa9ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ public DownloadData delivery(String packageName, int versionCode, int offerType)
.getAppDeliveryData();
return new DownloadData(this, appDeliveryData);
}

public DownloadData purchaseAndDeliver(String packageName, int versionCode, int offerType) throws IOException {
purchase(packageName, versionCode, offerType);
return delivery(packageName, versionCode, offerType);
}

/**
* Posts given check-in request content and returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public AppDownloadWorker(Globals globals, DocV2 doc) {
DocUtil.getAppIconUrl(doc));
profile = globals.get(DatabaseManager.class).get(PlayProfileDao.class)
.get();
paid = true; //doc.getOffer(0).getCheckoutFlowRequired();
paid = doc.getOffer(0).getCheckoutFlowRequired();
}

@Override
Expand Down Expand Up @@ -171,7 +171,7 @@ public void onPrepare() throws Exception {
}
else {
// for apps that can be downloaded free of charge.
data = api.download(packageName, versionCode, offerType);
data = api.purchaseAndDeliver(packageName, versionCode, offerType);
}

this.totalBytes = data.getTotalSize();
Expand Down

0 comments on commit 0aa9ceb

Please sign in to comment.