X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d6ccd4c9600822b08141ecaa7d19aed614ca2ed5..67eb921007efb1c9204e4b69fb85110fc23bf51f:/src/com/owncloud/android/syncadapter/FileSyncAdapter.java diff --git a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java index 7f4cf61b..db9d87db 100644 --- a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -34,6 +34,7 @@ import com.owncloud.android.authenticator.AccountAuthenticator; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.files.services.FileDownloader; +import com.owncloud.android.operations.RemoteOperationResult; import com.owncloud.android.utils.OwnCloudVersion; import android.accounts.Account; @@ -97,7 +98,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { Log.d(TAG, "syncing owncloud account " + account.name); - sendStickyBroadcast(true, null); // message to signal the start to the UI + sendStickyBroadcast(true, null, null); // message to signal the start to the UI updateOCVersion(); @@ -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()); notification.flags |= Notification.FLAG_AUTO_CANCEL; // TODO put something smart in the contentIntent below - notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT); + notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), (int)System.currentTimeMillis(), new Intent(), 0); notification.setLatestEventInfo(getContext().getApplicationContext(), getContext().getString(R.string.sync_fail_ticker), String.format(getContext().getString(R.string.sync_fail_content), account.name), @@ -315,13 +316,16 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { } - private void sendStickyBroadcast(boolean inProgress, String dirRemotePath) { + private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) { Intent i = new Intent(FileSyncService.SYNC_MESSAGE); i.putExtra(FileSyncService.IN_PROGRESS, inProgress); i.putExtra(FileSyncService.ACCOUNT_NAME, getAccount().name); if (dirRemotePath != null) { i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath); } + if (result != null) { + i.putExtra(FileSyncService.SYNC_RESULT, result); + } getContext().sendStickyBroadcast(i); }