Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java

Issue 2095473002: Revert of Roll internal Google Play Services (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
/**
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698