CommonStatusCodes

public class CommonStatusCodes

Known direct subclasses
ModuleInstallStatusCodes

Status code for module install APIs.


Common status codes that are often shared across API surfaces.

Summary

Constants

static final int

The client attempted to call a method from an API that failed to connect.

static final int

The result was canceled either due to client disconnect or cancel.

static final int

The connection was suspended while the call was in-flight.

static final int

The application is misconfigured.

static final int
ERROR = 13

The operation failed with no more detailed information.

static final int

An internal error occurred.

static final int

A blocking call was interrupted while waiting and did not run to completion.

static final int

The client attempted to connect to the service with an invalid account name specified.

static final int

A network error occurred.

static final int

The connection timed-out while attempting to re-connect.

static final int

The connection timed-out while waiting for Google Play services to update.

static final int

There was a non-DeadObjectExceptionRemoteException while calling a connected service.

static final int

Completing the operation requires some form of resolution.

static final int

This field is deprecated.

This case handled during connection, not during API requests.

static final int

This field is deprecated.

This case handled during connection, not during API requests.

static final int

The client attempted to connect to the service but the user is not signed in.

static final int

The operation was successful.

static final int

The operation was successful, but was used the device's cache.

static final int
TIMEOUT = 15

Timed out while awaiting the result.

Public methods

static @NonNull String
getStatusCodeString(int statusCode)

Returns untranslated debug string based on the current status code.

Constants

API_NOT_CONNECTED

public static final int API_NOT_CONNECTED = 17

The client attempted to call a method from an API that failed to connect. Possible reasons include:

  • The API previously failed to connect with a resolvable error, but the user declined the resolution.
  • The device does not support GmsCore.
  • The specific API cannot connect on this device.

CANCELED

public static final int CANCELED = 16

The result was canceled either due to client disconnect or cancel.

CONNECTION_SUSPENDED_DURING_CALL

public static final int CONNECTION_SUSPENDED_DURING_CALL = 20

The connection was suspended while the call was in-flight.

API calls will be failed with this status if onServiceDisconnected is called by the Android platform before the call is completed.

This indicates that the underlying service was bound, since onServiceDisconnected should never be called unless onServiceConnected was called first.

It is possible this failure could be resolved by retrying.

DEVELOPER_ERROR

public static final int DEVELOPER_ERROR = 10

The application is misconfigured. This error is not recoverable and will be treated as fatal. The developer should look at the logs after this to determine more actionable information.

ERROR

public static final int ERROR = 13

The operation failed with no more detailed information.

INTERNAL_ERROR

public static final int INTERNAL_ERROR = 8

An internal error occurred. Retrying should resolve the problem.

INTERRUPTED

public static final int INTERRUPTED = 14

A blocking call was interrupted while waiting and did not run to completion.

INVALID_ACCOUNT

public static final int INVALID_ACCOUNT = 5

The client attempted to connect to the service with an invalid account name specified.

NETWORK_ERROR

public static final int NETWORK_ERROR = 7

A network error occurred. Retrying should resolve the problem.

RECONNECTION_TIMED_OUT

public static final int RECONNECTION_TIMED_OUT = 22

The connection timed-out while attempting to re-connect.

This failure indicates a connection to Google Play services was successfully established, however it was disconnected for some reason (for example, Google Play services crashed), and re-connecting took longer than expected.

Any API calls failed with this status would have been initiated after the connection was disconnected.

RECONNECTION_TIMED_OUT_DURING_UPDATE

public static final int RECONNECTION_TIMED_OUT_DURING_UPDATE = 21

The connection timed-out while waiting for Google Play services to update.

This failure indicates a connection to Google Play services was successfully established, however it was disconnected because Google Play services was updated, and the update took far longer than expected.

Any API calls failed with this status would have been initiated after the disconnection for the update.

REMOTE_EXCEPTION

public static final int REMOTE_EXCEPTION = 19

There was a non-DeadObjectExceptionRemoteException while calling a connected service.

This signifies that an API was able to connect to Google Play services and received an instance, but that when calling an individual method, a RemoteException was thrown.

Note that the exception would not be a DeadObjectException, which indicates that the binding has died (for example if the remote process died). This is because DeadObjectExceptions are handled by the connection management infrastructure of GoogleApi.

If this is encountered during an API call for an API that uses the Google Play services ServiceBroker (most do), it is after a bound service is successfully received from the ServiceBroker.

RESOLUTION_REQUIRED

public static final int RESOLUTION_REQUIRED = 6

Completing the operation requires some form of resolution. A resolution will be available to be started with startResolutionForResult. If the result returned is RESULT_OK, then further attempts should either complete or continue on to the next issue that needs to be resolved.

SERVICE_DISABLED

public static final int SERVICE_DISABLED = 3

The installed version of Google Play services has been disabled on this device. The calling activity should pass this error code to getErrorDialog to get a localized error dialog that will resolve the error when shown.

SERVICE_VERSION_UPDATE_REQUIRED

public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2

The installed version of Google Play services is out of date. The calling activity should pass this error code to getErrorDialog to get a localized error dialog that will resolve the error when shown.

SIGN_IN_REQUIRED

public static final int SIGN_IN_REQUIRED = 4

The client attempted to connect to the service but the user is not signed in. The client may choose to continue without using the API. Alternately, if hasResolution returns true the client may call startResolutionForResult to prompt the user to sign in. After the sign in activity returns with RESULT_OK further attempts should succeed.

SUCCESS

public static final int SUCCESS = 0

The operation was successful.

SUCCESS_CACHE

public static final int SUCCESS_CACHE = -1

The operation was successful, but was used the device's cache. If this is a write, the data will be written when the device is online; errors will be written to the logs. If this is a read, the data was read from a device cache and may be stale.

TIMEOUT

public static final int TIMEOUT = 15

Timed out while awaiting the result.

Public methods

getStatusCodeString

public static @NonNull String getStatusCodeString(int statusCode)

Returns untranslated debug string based on the current status code.