projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reviewed integration with sychronization framework to fix problems in Android 4.4
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
operations
/
RemoteOperationResult.java
diff --git
a/src/com/owncloud/android/operations/RemoteOperationResult.java
b/src/com/owncloud/android/operations/RemoteOperationResult.java
index
5701476
..
8d9b3ee
100644
(file)
--- a/
src/com/owncloud/android/operations/RemoteOperationResult.java
+++ b/
src/com/owncloud/android/operations/RemoteOperationResult.java
@@
-33,13
+33,14
@@
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.DavException;
-import android.accounts.Account;
-import android.accounts.AccountsException;
-
import com.owncloud.android.Log_OC;
import com.owncloud.android.authentication.AccountUtils.AccountNotFoundException;
import com.owncloud.android.network.CertificateCombinedException;
import com.owncloud.android.Log_OC;
import com.owncloud.android.authentication.AccountUtils.AccountNotFoundException;
import com.owncloud.android.network.CertificateCombinedException;
+import android.accounts.Account;
+import android.accounts.AccountsException;
+
+
/**
* The result of a remote operation required to an ownCloud server.
*
/**
* The result of a remote operation required to an ownCloud server.
*
@@
-51,7
+52,8
@@
import com.owncloud.android.network.CertificateCombinedException;
public class RemoteOperationResult implements Serializable {
/** Generated - should be refreshed every time the class changes!! */
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";
private static final String TAG = "RemoteOperationResult";
@@
-85,7
+87,9
@@
public class RemoteOperationResult implements Serializable {
OAUTH2_ERROR_ACCESS_DENIED,
QUOTA_EXCEEDED,
ACCOUNT_NOT_FOUND,
OAUTH2_ERROR_ACCESS_DENIED,
QUOTA_EXCEEDED,
ACCOUNT_NOT_FOUND,
- ACCOUNT_EXCEPTION
+ ACCOUNT_EXCEPTION,
+ ACCOUNT_NOT_NEW,
+ ACCOUNT_NOT_THE_SAME
}
private boolean mSuccess = false;
}
private boolean mSuccess = false;
@@
-99,7
+103,7
@@
public class RemoteOperationResult implements Serializable {
mSuccess = (code == ResultCode.OK || code == ResultCode.OK_SSL || code == ResultCode.OK_NO_SSL);
}
mSuccess = (code == ResultCode.OK || code == ResultCode.OK_SSL || code == ResultCode.OK_NO_SSL);
}
- p
ublic
RemoteOperationResult(boolean success, int httpCode) {
+ p
rivate
RemoteOperationResult(boolean success, int httpCode) {
mSuccess = success;
mHttpCode = httpCode;
mSuccess = success;
mHttpCode = httpCode;
@@
-297,6
+301,12
@@
public class RemoteOperationResult implements Serializable {
} else if (mCode == ResultCode.LOCAL_STORAGE_NOT_MOVED) {
return "Error while moving file to final directory";
} 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") + ")";
}
return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess() ? "success" : "fail") + ")";
@@
-320,8
+330,9
@@
public class RemoteOperationResult implements Serializable {
}
public boolean isIdPRedirection() {
}
public boolean isIdPRedirection() {
- return (mRedirectedLocation.toUpperCase().contains("SAML") ||
- mRedirectedLocation.toLowerCase().contains("wayf"));
+ return (mRedirectedLocation != null &&
+ (mRedirectedLocation.toUpperCase().contains("SAML") ||
+ mRedirectedLocation.toLowerCase().contains("wayf")));
}
}
}
}