Commit 2b90560c authored by Rouslan Solomakhin's avatar Rouslan Solomakhin Committed by Commit Bot

[Web Payment] Hide service worker when native app is installed.

Before this patch, BobPay native Android payment app could be displayed
side-by-side with BobPay service worker based payment app, even if the
web app manifest was configured to prefer the native payment app.

This patch adds a
PaymentInstrument.getApplicationIdentifiersThatHideThisApp() override in
ServiceWorkerPaymentApp, which was accidentally deleted in
https://crrev.com/c/1988215 as it was being renamed from
PaymentApp.getPreferredRelatedApplicationIds().

After this patch, BobPay native Android payment hides the service worker
based payment app.

Bug: 1049217
Change-Id: Id439daf9435317be30885e1e0adafce1284481ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2039632
Auto-Submit: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: default avatarDanyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739091}
parent 124bfbe9
...@@ -339,4 +339,10 @@ public class ServiceWorkerPaymentApp extends PaymentInstrument { ...@@ -339,4 +339,10 @@ public class ServiceWorkerPaymentApp extends PaymentInstrument {
public String accountBalance() { public String accountBalance() {
return "18.00"; // TODO(https://crbug.com/1000432): Implement microtransactions. return "18.00"; // TODO(https://crbug.com/1000432): Implement microtransactions.
} }
@Override
@Nullable
public Set<String> getApplicationIdentifiersThatHideThisApp() {
return mPreferredRelatedApplicationIds;
}
} }
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