public class RemoteOperationResult implements Serializable {
/** Generated - should be refreshed every time the class changes!! */
- private static final long serialVersionUID = 3267227833178885664L;
+ private static final long serialVersionUID = -4415103901492836870L;
private static final String TAG = "RemoteOperationResult";
OAUTH2_ERROR_ACCESS_DENIED,
QUOTA_EXCEEDED,
ACCOUNT_NOT_FOUND,
- ACCOUNT_EXCEPTION
+ ACCOUNT_EXCEPTION,
+ ACCOUNT_NOT_NEW,
+ ACCOUNT_NOT_THE_SAME
}
private boolean mSuccess = false;
mSuccess = (code == ResultCode.OK || code == ResultCode.OK_SSL || code == ResultCode.OK_NO_SSL);
}
- public RemoteOperationResult(boolean success, int httpCode) {
+ private RemoteOperationResult(boolean success, int httpCode) {
mSuccess = success;
mHttpCode = httpCode;
} else if (mCode == ResultCode.LOCAL_STORAGE_NOT_MOVED) {
return "Error while moving file to final directory";
+
+ } else if (mCode == ResultCode.ACCOUNT_NOT_NEW) {
+ return "Account already existing when creating a new one";
+
+ } else if (mCode == ResultCode.ACCOUNT_NOT_THE_SAME) {
+ return "Authenticated with a different account than the one updating";
}
return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess() ? "success" : "fail") + ")";
}
public boolean isIdPRedirection() {
- return (mRedirectedLocation.toUpperCase().contains("SAML") ||
- mRedirectedLocation.toLowerCase().contains("wayf"));
+ return (mRedirectedLocation != null &&
+ (mRedirectedLocation.toUpperCase().contains("SAML") ||
+ mRedirectedLocation.toLowerCase().contains("wayf")));
}
}