Browse Source

Fixed redirection to login view from failed notifications when click on

David A. Velasco 10 years ago
parent
commit
78a2ba5868

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit a57be369259bbfb3741a649a8d585fc8de6ac669
+Subproject commit 4c8f31df2fb63dbb29be6eacfb8767bc73a34312

+ 4 - 3
src/com/owncloud/android/files/services/FileDownloader.java

@@ -470,9 +470,10 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
             int tickerId = (downloadResult.isSuccess()) ? R.string.downloader_download_succeeded_ticker : 
                 R.string.downloader_download_failed_ticker;
             
-            boolean needsToUpdateCredentials = (downloadResult.getCode() == ResultCode.UNAUTHORIZED ||
-                                                  (downloadResult.isIdPRedirection()
-                                                        && mDownloadClient.getCredentials() == null));
+            boolean needsToUpdateCredentials = (
+                    downloadResult.getCode() == ResultCode.UNAUTHORIZED ||
+                    downloadResult.isIdPRedirection()
+            );
             tickerId = (needsToUpdateCredentials) ? 
                     R.string.downloader_download_failed_credentials_error : tickerId;
             

+ 4 - 3
src/com/owncloud/android/files/services/FileUploader.java

@@ -741,9 +741,10 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
             String content = null;
 
             // check credentials error
-            boolean needsToUpdateCredentials = (uploadResult.getCode() == ResultCode.UNAUTHORIZED || 
-                    (uploadResult.isIdPRedirection() &&
-                            mUploadClient.getCredentials() == null));
+            boolean needsToUpdateCredentials = (
+                    uploadResult.getCode() == ResultCode.UNAUTHORIZED || 
+                    uploadResult.isIdPRedirection()
+            );
             tickerId = (needsToUpdateCredentials) ? 
                     R.string.uploader_upload_failed_credentials_error : tickerId;