Commit 0de6ec1b authored by Sam Maier's avatar Sam Maier Committed by Chromium LUCI CQ

Revert "GMSCore API availability function for specific versions"

This reverts commit 6a6c700a.

Reason for revert: https://logs.chromium.org/logs/chrome/buildbucket/cr-buildbucket.appspot.com/8860631130980203728/+/steps/compile__with_patch_/0/stdout

Original change's description:
> GMSCore API availability function for specific versions
>
> Change-Id: Ie431852d225659e8b24bfec9c09d7c043924660f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595929
> Commit-Queue: Sam Maier <smaier@chromium.org>
> Reviewed-by: David Van Cleve <davidvc@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#838236}

TBR=smaier@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,davidvc@chromium.org

Change-Id: Iac1a894b3d3adaa58c0fcfefd407cd8db82b3e56
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597817Reviewed-by: default avatarSam Maier <smaier@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838253}
parent ecc22ee2
...@@ -8,20 +8,20 @@ import android.content.Context; ...@@ -8,20 +8,20 @@ import android.content.Context;
import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.common.GoogleApiAvailability;
// Refer to go/doubledown-play-services#new-apis for more detail.
public final class ChromiumPlayServicesAvailability { public final class ChromiumPlayServicesAvailability {
/** /**
* The minimum GMS version we're requesting. isGooglePlayServicesAvailable will fail if the * The minimum GMS version we're requesting. isGooglePlayServicesAvailable will fail if the
* found version on the devices is lower than this number. This number should never be updated; * found version on the devices is lower than this number. This number should only be updated
* if you need to check for a higher number, use * when using an API introduced in a newer GMS version, and that API usage is gated by this
* {@link GoogleApiAvailability#isGooglePlayServicesAvailable(Context, int))} instead. * class. To see how this number originated, see
* To see how this number originated, see
* https://bugs.chromium.org/p/chromium/issues/detail?id=1145211#c3. * https://bugs.chromium.org/p/chromium/issues/detail?id=1145211#c3.
*/ */
public static final int DEFAULT_GMS_VERSION_NUMBER = 20415000; public static final int GMS_VERSION_NUMBER = 20415000;
/** /**
* Checks if Play Services is available in this context. * Checks, with an appropriate version number, if Play Services is available in this context.
* This is intended to replace anyone manually calling isGooglePlayServicesAvailable(context),
* as it causes bugs without an appropriate version number (crbug.com/1145211).
* *
* If at all possible, do not use this. From a GMSCore team member: "we would not recommend * If at all possible, do not use this. From a GMSCore team member: "we would not recommend
* checking availability upfront. You should be able to just call the API directly, and it * checking availability upfront. You should be able to just call the API directly, and it
...@@ -29,19 +29,13 @@ public final class ChromiumPlayServicesAvailability { ...@@ -29,19 +29,13 @@ public final class ChromiumPlayServicesAvailability {
* the user to update GMS Core or fail with exception." If in doubt, please consult with your * the user to update GMS Core or fail with exception." If in doubt, please consult with your
* PM/UX. * PM/UX.
*/ */
public static boolean isGooglePlayServicesAvailable(final Context context) { public static int getGooglePlayServicesConnectionResult(final Context context) {
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable( return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
context, DEFAULT_GMS_VERSION_NUMBER) context, GMS_VERSION_NUMBER);
== ConnectionResult.SUCCESS;
} }
/** /**
* Gets Play Services connection result, to be used to see if Play Services are available. * Checks if Play Services is available in this context.
*
* This is intended to replace anyone manually calling
* {@link GoogleApiAvailability#isGooglePlayServicesAvailable(context)},
* as it causes bugs without an appropriate version number (crbug.com/1145211). Use
* isGooglePlayServicesAvailable if you don't explicitly need the connection result.
* *
* If at all possible, do not use this. From a GMSCore team member: "we would not recommend * If at all possible, do not use this. From a GMSCore team member: "we would not recommend
* checking availability upfront. You should be able to just call the API directly, and it * checking availability upfront. You should be able to just call the API directly, and it
...@@ -49,8 +43,9 @@ public final class ChromiumPlayServicesAvailability { ...@@ -49,8 +43,9 @@ public final class ChromiumPlayServicesAvailability {
* the user to update GMS Core or fail with exception." If in doubt, please consult with your * the user to update GMS Core or fail with exception." If in doubt, please consult with your
* PM/UX. * PM/UX.
*/ */
public static int getGooglePlayServicesConnectionResult(final Context context) { public static boolean isGooglePlayServicesAvailable(final Context context) {
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable( return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
context, DEFAULT_GMS_VERSION_NUMBER); context, GMS_VERSION_NUMBER)
== ConnectionResult.SUCCESS;
} }
} }
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