Index: chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
index 27f5a9aef3fedd8b522683eb542c34b83e648a1e..733a71a87f445d8d5df32c9ea85a1f4596dabcb8 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
@@ -96,15 +96,16 @@ |
* @return whether the currently running application is signed with Google keys. |
*/ |
public boolean isChromeGoogleSigned(Context context) { |
- return isGoogleSigned(context, context.getPackageName()); |
+ return isGoogleSigned( |
+ context.getApplicationContext().getPackageManager(), context.getPackageName()); |
} |
/** |
* Returns whether the call is originating from a Google-signed package. |
- * @param appContext the current context. |
+ * @param pm Package manager to use for getting package related info. |
* @param packageName The package name to inquire about. |
*/ |
- public boolean isGoogleSigned(Context context, String packageName) { |
+ public boolean isGoogleSigned(PackageManager pm, String packageName) { |
// This is overridden in a subclass. |
return false; |
} |
@@ -128,7 +129,7 @@ |
for (String packageName : callingPackages) { |
if (!TextUtils.isEmpty(packageToMatch) && !packageName.equals(packageToMatch)) continue; |
matchFound = true; |
- if ((shouldBeGoogleSigned && !isGoogleSigned(context, packageName)) |
+ if ((shouldBeGoogleSigned && !isGoogleSigned(pm, packageName)) |
|| (shouldBeSystem && !isSystemBuild(pm, packageName))) { |
return false; |
} |
@@ -215,7 +216,7 @@ |
public boolean canUseFirstPartyGooglePlayServices( |
Context context, UserRecoverableErrorHandler userRecoverableErrorHandler) { |
return canUseGooglePlayServices(context, userRecoverableErrorHandler) |
- && isChromeGoogleSigned(context); |
+ && isGoogleSigned(context.getPackageManager(), context.getPackageName()); |
} |
/** |