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

The following examples show how to use com.google.android.gms.common.ConnectionResult#SERVICE_VERSION_UPDATE_REQUIRED . 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: 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 2
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 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 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 5
Source File: ControllerActivity.java    From Bluefruit_LE_Connect_Android with MIT License 5 votes vote down vote up
@Override
public void onResume() {
    Log.d(TAG, "onResume");

    super.onResume();

    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (resultCode == ConnectionResult.SERVICE_MISSING ||
            resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED ||
            resultCode == ConnectionResult.SERVICE_DISABLED) {

        Dialog googlePlayErrorDialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 0);
        if (googlePlayErrorDialog != null) {
            googlePlayErrorDialog.show();
        }
    }

    // Setup listeners
    mBleManager.setBleListener(this);

    registerEnabledSensorListeners(true);

    // Setup send data task
    if (!isSensorPollingEnabled) {
        sendDataHandler.postDelayed(mPeriodicallySendData, kSendDataInterval);
        isSensorPollingEnabled = true;
    }
}
 
Example 6
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 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: MainActivity.java    From AndroidDemoProjects with Apache License 2.0 5 votes vote down vote up
private void verifyPlayServices() {
	switch ( GooglePlayServicesUtil.isGooglePlayServicesAvailable( this ) ) {
		case ConnectionResult.SUCCESS: {
			break;
		}
		case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED: {
			finish();
		}
		default: {
			finish();
		}
	}
}
 
Example 12
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 13
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 14
Source File: ExternalAuthUtils.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * @param errorCode returned by {@link #checkGooglePlayServicesAvailable(Context)}.
 * @return true if the error code indicates that an invalid version of Google Play Services is
 *         installed.
 */
public boolean isGooglePlayServicesUpdateRequiredError(int errorCode) {
    return errorCode == ConnectionResult.SERVICE_UPDATING
            || errorCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED
            || errorCode == ConnectionResult.SERVICE_DISABLED
            || errorCode == ConnectionResult.SERVICE_MISSING;
}
 
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
/**
 * @param errorCode returned by {@link #checkGooglePlayServicesAvailable(Context)}.
 * @return true if the error code indicates that an invalid version of Google Play Services is
 *         installed.
 */
public boolean isGooglePlayServicesUpdateRequiredError(int errorCode) {
    return errorCode == ConnectionResult.SERVICE_UPDATING
            || errorCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED
            || errorCode == ConnectionResult.SERVICE_DISABLED
            || errorCode == ConnectionResult.SERVICE_MISSING;
}
 
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: ControllerFragment.java    From Bluefruit_LE_Connect_Android_V2 with MIT License 5 votes vote down vote up
@Override
public void onResume() {
    Log.d(TAG, "onResume");

    super.onResume();

    final Context context = getContext();

    GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
    int resultCode = apiAvailability.isGooglePlayServicesAvailable(context);
    if (resultCode == ConnectionResult.SERVICE_MISSING ||
            resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED ||
            resultCode == ConnectionResult.SERVICE_DISABLED) {

        Dialog googlePlayErrorDialog = apiAvailability.getErrorDialog(getActivity(), resultCode, MainActivity.kActivityRequestCode_PlayServicesAvailability);
        if (googlePlayErrorDialog != null) {
            googlePlayErrorDialog.show();
        }
    }

    // Setup listeners
    if (context != null) {
        registerEnabledSensorListeners(context, true);
    }

    // Setup send data task
    if (!isSensorPollingEnabled) {
        sendDataHandler.postDelayed(mPeriodicallySendData, kSendDataInterval);
        isSensorPollingEnabled = true;
    }
}