Updating synchronization for providing SSL warning when necessary; step 1: refactorin...
[pub/Android/ownCloud.git] / src / com / owncloud / android / syncadapter / FileSyncAdapter.java
index 7f4cf61..ec62091 100644 (file)
@@ -34,6 +34,7 @@ import com.owncloud.android.authenticator.AccountAuthenticator;
 import com.owncloud.android.datamodel.FileDataStorageManager;\r
 import com.owncloud.android.datamodel.OCFile;\r
 import com.owncloud.android.files.services.FileDownloader;\r
+import com.owncloud.android.operations.RemoteOperationResult;\r
 import com.owncloud.android.utils.OwnCloudVersion;\r
 \r
 import android.accounts.Account;\r
@@ -149,7 +150,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                 Notification notification = new Notification(R.drawable.icon, getContext().getString(R.string.sync_fail_ticker), System.currentTimeMillis());\r
                 notification.flags |= Notification.FLAG_AUTO_CANCEL;\r
                 // TODO put something smart in the contentIntent below\r
-                notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);\r
+                notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), (int)System.currentTimeMillis(), new Intent(), 0);\r
                 notification.setLatestEventInfo(getContext().getApplicationContext(), \r
                                                 getContext().getString(R.string.sync_fail_ticker), \r
                                                 String.format(getContext().getString(R.string.sync_fail_content), account.name), \r
@@ -315,13 +316,16 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
     }\r
     \r
     \r
-    private void sendStickyBroadcast(boolean inProgress, String dirRemotePath) {\r
+    private void sendStickyBroadcast(boolean inProgress, String dirRemotePath/*, RemoteOperationResult result*/) {\r
         Intent i = new Intent(FileSyncService.SYNC_MESSAGE);\r
         i.putExtra(FileSyncService.IN_PROGRESS, inProgress);\r
         i.putExtra(FileSyncService.ACCOUNT_NAME, getAccount().name);\r
         if (dirRemotePath != null) {\r
             i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath);\r
         }\r
+        /*if (result != null) {\r
+            i.putExtra(FileSyncService.SYNC_RESULT, result);\r
+        }*/\r
         getContext().sendStickyBroadcast(i);\r
     }\r
     \r