Commit b5c644c9 authored by Nick Burris's avatar Nick Burris Committed by Commit Bot

Fix failed assert on invalid app store payment app

In crrev.com/c/2254058, AndroidPaymentAppFinder was changed to mark app
store payment apps as preferred payment apps. The patch made the
assumption that the payment app was valid, which is not necessarily the
case, e.g. if the TWA has an invalid app store payment app identifier.
This patch checks for the app rather than asserting.

Verified fix with the test TWA from the bug.

Bug: 1120346
Change-Id: Ibd3f5bcd8f562d46583b1e580a3fc997d848c58f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369255Reviewed-by: default avatarLiquan (Max) Gu <maxlg@chromium.org>
Commit-Queue: Nick Burris <nburris@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801479}
parent 8b0c02e2
......@@ -226,10 +226,8 @@ public class AndroidPaymentAppFinder implements ManifestVerifyCallback {
}
}
String packageName = twaApp.activityInfo.packageName;
AndroidPaymentApp app = mValidApps.get(packageName);
assert app != null;
app.setIsPreferred(true);
AndroidPaymentApp app = mValidApps.get(twaPackageName);
if (app != null) app.setIsPreferred(true);
}
private boolean paymentAppSupportsUriMethod(ResolveInfo app, GURL urlMethod) {
......
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