Chromium Code Reviews| 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 f998065dc3edb7ff2270dd05434804556705f987..db9ea63f6b9c90809e9f1f068144d86ca1634ff1 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 |
| @@ -17,6 +17,7 @@ import android.text.TextUtils; |
| import com.google.android.gms.common.ConnectionResult; |
| import com.google.android.gms.common.GoogleApiAvailability; |
| +import org.chromium.base.ContextUtils; |
| import org.chromium.base.Log; |
| import org.chromium.base.ThreadUtils; |
| import org.chromium.base.VisibleForTesting; |
| @@ -89,6 +90,7 @@ public class ExternalAuthUtils { |
| return true; |
| } |
| + // TODO(paulmiller): Remove; replaced by no-argument isChromeGoogleSigned(). |
| /** |
| * Returns whether the current build of Chrome is a Google-signed package. |
| * |
| @@ -100,12 +102,31 @@ public class ExternalAuthUtils { |
| } |
| /** |
| + * Returns whether the current build of Chrome is a Google-signed package. |
| + * @return whether the currently running application is signed with Google keys. |
| + */ |
| + public boolean isChromeGoogleSigned() { |
| + String packageName = ContextUtils.getApplicationContext().getPackageName(); |
| + return isGoogleSigned(null, packageName); |
|
Maria
2017/04/06 23:23:15
shouldn't you be calling isGoogleSigned(packageNam
paulmiller
2017/04/06 23:25:56
Not yet. Downstream still overrides the old isGoog
Maria
2017/04/06 23:37:10
There's no reason not to switch it right now. This
|
| + } |
| + |
| + // TODO(paulmiller): Remove; replaced by isGoogleSigned(String). |
| + /** |
| * Returns whether the call is originating from a Google-signed package. |
| * @param appContext the current context. |
| * @param packageName The package name to inquire about. |
| */ |
| public boolean isGoogleSigned(Context context, String packageName) { |
| // This is overridden in a subclass. |
| + return isGoogleSigned(packageName); |
| + } |
| + |
| + /** |
| + * Returns whether the call is originating from a Google-signed package. |
| + * @param packageName The package name to inquire about. |
| + */ |
| + public boolean isGoogleSigned(String packageName) { |
| + // This is overridden in a subclass. |
| return false; |
| } |