import com.owncloud.android.Log_OC;
import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountAuthenticator;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.DataStorageManager;
import com.owncloud.android.datamodel.FileDataStorageManager;
List<OCFile> children = synchFolderOp.getChildren();
fetchChildren(children); // beware of the 'hidden' recursion here!
+ sendStickyBroadcast(true, remotePath, null);
+
} else {
- if (result.getCode() == RemoteOperationResult.ResultCode.UNAUTHORIZED) {
+ if (result.getCode() == RemoteOperationResult.ResultCode.UNAUTHORIZED ||
+ (result.isTemporalRedirection() && result.isIdPRedirection() &&
+ AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(getClient().getAuthTokenType()))) {
mSyncResult.stats.numAuthExceptions++;
} else if (result.getException() instanceof DavException) {
fetchData(newFile.getRemotePath(), newFile.getFileId());
// Update folder size on DB
- FileDataStorageManager storageManager = new FileDataStorageManager(getAccount(), getContext().getContentResolver());
- storageManager.saveFolderSize(newFile.getFileId());
+ getStorageManager().calculateFolderSize(newFile.getFileId());
}
}
private void notifyFailedSynchronization() {
Notification notification = new Notification(R.drawable.icon, getContext().getString(R.string.sync_fail_ticker), System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
- boolean needsToUpdateCredentials = (mLastFailedResult != null && mLastFailedResult.getCode() == ResultCode.UNAUTHORIZED);
+ boolean needsToUpdateCredentials = (mLastFailedResult != null &&
+ ( mLastFailedResult.getCode() == ResultCode.UNAUTHORIZED ||
+ (mLastFailedResult.isTemporalRedirection() && mLastFailedResult.isIdPRedirection() &&
+ AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(getClient().getAuthTokenType()))
+ )
+ );
// TODO put something smart in the contentIntent below for all the possible errors
notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), (int)System.currentTimeMillis(), new Intent(), 0);
if (needsToUpdateCredentials) {