| Index: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
|
| diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
|
| index 2fc1e46694f8cdc92fbab00bdff47e7cd9de9809..81158f91a9941f1c0104a6fab4081224a0d03678 100644
|
| --- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
|
| +++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
|
| @@ -44,6 +44,17 @@ public class WebApkValidator {
|
| private static byte[] sCommentSignedPublicKeyBytes;
|
| private static PublicKey sCommentSignedPublicKey;
|
|
|
| + /** Used to notified the consumer after checking whether the current app owns the WebAPK. */
|
| + public abstract static class IsOwnedCheckCallback
|
| + implements WebApkIdentityServiceClient.CheckRuntimeHostCallback {
|
| + public abstract void onIsOwnedChecked(boolean isOwned);
|
| +
|
| + @Override
|
| + public void onCheckedRuntimeHost(boolean isValid) {
|
| + onIsOwnedChecked(isValid);
|
| + }
|
| + }
|
| +
|
| /**
|
| * Queries the PackageManager to determine whether a WebAPK can handle the URL. Ignores whether
|
| * the user has selected a default handler for the URL and whether the default handler is the
|
| @@ -103,6 +114,13 @@ public class WebApkValidator {
|
| return false;
|
| }
|
|
|
| + /** Checks whether the current app is the runtime host of the WebAPK asynchronously. */
|
| + public static void isOwnedWebApkAsync(
|
| + Context appContext, String webApkPackageName, IsOwnedCheckCallback callback) {
|
| + WebApkIdentityServiceClient.checkWebApkRuntimeHostAsync(
|
| + appContext, webApkPackageName, callback);
|
| + }
|
| +
|
| /**
|
| * Fetches the list of resolve infos from the PackageManager that can handle the URL.
|
| *
|
|
|