This source file includes following definitions.
- NONE
- INVALID_GAIA_CREDENTIALS
- USER_NOT_SIGNED_UP
- CONNECTION_FAILED
- CAPTCHA_REQUIRED
- ACCOUNT_DELETED
- ACCOUNT_DISABLED
- SERVICE_UNAVAILABLE
- TWO_FACTOR
- REQUEST_CANCELED
- HOSTED_NOT_ALLOWED
- fromCode
- getMessage
- getState
package org.chromium.chrome.browser.sync;
import org.chromium.chrome.R;
public class GoogleServiceAuthError {
public enum State {
NONE(0, R.string.sync_error_generic),
INVALID_GAIA_CREDENTIALS(1, R.string.sync_error_ga),
USER_NOT_SIGNED_UP(2, R.string.sync_error_generic),
CONNECTION_FAILED(3, R.string.sync_error_connection),
CAPTCHA_REQUIRED(4, R.string.sync_error_generic),
ACCOUNT_DELETED(5, R.string.sync_error_generic),
ACCOUNT_DISABLED(6, R.string.sync_error_generic),
SERVICE_UNAVAILABLE(7, R.string.sync_error_service_unavailable),
TWO_FACTOR(8, R.string.sync_error_generic),
REQUEST_CANCELED(9, R.string.sync_error_generic),
HOSTED_NOT_ALLOWED(10, R.string.sync_error_domain);
private final int mCode;
private final int mMessage;
State(int code, int message) {
mCode = code;
mMessage = message;
}
public static State fromCode(int code) {
for (State state : State.values()) {
if (state.mCode == code) {
return state;
}
}
throw new IllegalArgumentException("No state for code: " + code);
}
public int getMessage() {
return mMessage;
}
}
private final State mState;
GoogleServiceAuthError(int code) {
mState = State.fromCode(code);
}
State getState() {
return mState;
}
}