Java Code Examples for com.google.android.gms.common.ConnectionResult#SERVICE_INVALID

The following examples show how to use com.google.android.gms.common.ConnectionResult#SERVICE_INVALID . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayNetwork.java    From CrossBow with Apache License 2.0 6 votes vote down vote up
private static void throwErrorForCode(int code) throws VolleyError {

        final String message;

        switch (code) {
            case ConnectionResult.SERVICE_MISSING:
                message = "Play Services is missing";
                break;
            case ConnectionResult.SERVICE_UPDATING:
                message = "Play Services is updating";
                break;
            case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
                message = "Play Services is running the wrong version";
                break;
            case ConnectionResult.SERVICE_DISABLED:
                message = "Play Services is disabled";
                break;
            case ConnectionResult.SERVICE_INVALID:
                message = "Play Services is invalid";
                break;
            default:
                message = "Connection to play services failed";
        }

        throw new VolleyError(message);
    }
 
Example 2
Source File: GmsApiWrapper.java    From rebootmenu with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 取Google Play Service可用性状态
 *
 * @param context context
 * @return String
 */
public static String fetchStateString(Context context) {
    switch (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context.getApplicationContext())) {
        case ConnectionResult.SUCCESS:
            return "SUCCESS";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING";
        case ConnectionResult.SERVICE_UPDATING:
            return "SERVICE_UPDATING";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID";
    }
    return null;
}
 
Example 3
Source File: GameHelperUtils.java    From google-play-game-services-ane with MIT License 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 4
Source File: GameHelperUtils.java    From ANE-Google-Play-Game-Services with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 5
Source File: GameHelperUtils.java    From cordova-google-play-games-services with MIT License 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 6
Source File: GameHelperUtils.java    From FlappyCow with MIT License 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 7
Source File: GameHelperUtils.java    From tedroid with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 8
Source File: GameHelperUtils.java    From Onesearch with MIT License 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 9
Source File: GameHelperUtils.java    From io2014-codelabs with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 10
Source File: GameHelperUtils.java    From io2014-codelabs with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 11
Source File: GameHelperUtils.java    From ColorPhun with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 12
Source File: PlayServicesUtil.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
public static PlayServicesStatus getPlayServicesStatus(Context context) {
  int gcmStatus = 0;

  try {
    gcmStatus = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
  } catch (Throwable t) {
    Log.w(TAG, t);
    return PlayServicesStatus.MISSING;
  }

  Log.i(TAG, "Play Services: " + gcmStatus);

  switch (gcmStatus) {
    case ConnectionResult.SUCCESS:
      return PlayServicesStatus.SUCCESS;
    case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
      try {
        ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo("com.google.android.gms", 0);

        if (applicationInfo != null && !applicationInfo.enabled) {
          return PlayServicesStatus.MISSING;
        }
      } catch (PackageManager.NameNotFoundException e) {
        Log.w(TAG, e);
      }

      return PlayServicesStatus.NEEDS_UPDATE;
    case ConnectionResult.SERVICE_DISABLED:
    case ConnectionResult.SERVICE_MISSING:
    case ConnectionResult.SERVICE_INVALID:
    case ConnectionResult.API_UNAVAILABLE:
    case ConnectionResult.SERVICE_MISSING_PERMISSION:
      return PlayServicesStatus.MISSING;
    default:
      return PlayServicesStatus.TRANSIENT_ERROR;
  }
}
 
Example 13
Source File: GameHelperUtils.java    From martianrun with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 14
Source File: ExternalAuthUtils.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * @return Whether the current device lacks proper Google Play Services. This will return true
 *         if the service is not authentic or it is totally missing. Return false otherwise.
 *         Note this method returns false if the service is only temporarily disabled, such as
 *         when it is updating.
 */
public boolean isGooglePlayServicesMissing(final Context context) {
    final int resultCode = checkGooglePlayServicesAvailable(context);
    if (resultCode == ConnectionResult.SERVICE_MISSING
            || resultCode == ConnectionResult.SERVICE_INVALID) {
        return true;
    }
    return false;
}
 
Example 15
Source File: GameHelperUtils.java    From FixMath with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 16
Source File: GameHelperUtils.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 17
Source File: ExternalAuthUtils.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * @return Whether the current device lacks proper Google Play Services. This will return true
 *         if the service is not authentic or it is totally missing. Return false otherwise.
 *         Note this method returns false if the service is only temporarily disabled, such as
 *         when it is updating.
 */
public boolean isGooglePlayServicesMissing(final Context context) {
    final int resultCode = checkGooglePlayServicesAvailable(context);
    if (resultCode == ConnectionResult.SERVICE_MISSING
            || resultCode == ConnectionResult.SERVICE_INVALID) {
        return true;
    }
    return false;
}
 
Example 18
Source File: GameHelperUtils.java    From Trivia-Knowledge with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 19
Source File: GameHelperUtils.java    From Asteroid with Apache License 2.0 5 votes vote down vote up
static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
Example 20
Source File: GooglePlayServicesHelper.java    From react-native-sms-retriever with MIT License 5 votes vote down vote up
static boolean isAvailable(@NonNull final Context context) {
    final int result = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);

    return (result != ConnectionResult.SERVICE_MISSING
            && result != ConnectionResult.SERVICE_DISABLED
            && result != ConnectionResult.SERVICE_INVALID);
}