Commit cdb75d30 authored by Kim Paulhamus's avatar Kim Paulhamus Committed by Commit Bot

Gracefully handle a null ChromeActivity when calling isUVPAA.

Bug: 913881
Change-Id: I291167a9f707afe19709aabf212e01aed8d4e201
Reviewed-on: https://chromium-review.googlesource.com/c/1372911Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Kim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615981}
parent 59d0480b
...@@ -95,6 +95,11 @@ public class AuthenticatorImpl implements Authenticator, HandlerResponseCallback ...@@ -95,6 +95,11 @@ public class AuthenticatorImpl implements Authenticator, HandlerResponseCallback
public void isUserVerifyingPlatformAuthenticatorAvailable( public void isUserVerifyingPlatformAuthenticatorAvailable(
IsUserVerifyingPlatformAuthenticatorAvailableResponse callback) { IsUserVerifyingPlatformAuthenticatorAvailableResponse callback) {
Context context = ChromeActivity.fromWebContents(mWebContents); Context context = ChromeActivity.fromWebContents(mWebContents);
// ChromeActivity could be null.
if (context == null) {
callback.call(false);
}
if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME) < GMSCORE_MIN_VERSION if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME) < GMSCORE_MIN_VERSION
|| Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { || Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
callback.call(false); callback.call(false);
......
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