X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/35bf347759e43efff51c28ab8aaaf7e4aa3c2033..1a33e4cf6582c480be3097fcd65fb7ccd876f51a:/src/com/owncloud/android/files/services/FileUploader.java diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index 8a7ceda5..d302e267 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -54,6 +54,7 @@ import com.owncloud.android.ui.activity.InstantUploadActivity; import com.owncloud.android.ui.preview.PreviewImageActivity; import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.utils.Log_OC; +import com.owncloud.android.utils.NotificationBuilderWithProgressBar; import android.accounts.Account; import android.accounts.AccountManager; @@ -252,8 +253,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe AccountManager aMgr = AccountManager.get(this); String version = aMgr.getUserData(account, Constants.KEY_OC_VERSION); - String versionString = aMgr.getUserData(account, Constants.KEY_OC_VERSION_STRING); - OwnCloudVersion ocv = new OwnCloudVersion(version, versionString); + OwnCloudVersion ocv = new OwnCloudVersion(version); boolean chunked = FileUploader.chunkedUploadIsSupported(ocv); AbstractList requestedUploads = new Vector(); @@ -678,7 +678,8 @@ public class FileUploader extends Service implements OnDatatransferProgressListe private void notifyUploadStart(UploadFileOperation upload) { // / create status notification with a progress bar mLastPercent = 0; - mNotificationBuilder = new NotificationCompat.Builder(this); + mNotificationBuilder = + NotificationBuilderWithProgressBar.newNotificationBuilderWithProgressBar(this); mNotificationBuilder .setOngoing(true) .setSmallIcon(R.drawable.notification_icon) @@ -731,7 +732,10 @@ public class FileUploader extends Service implements OnDatatransferProgressListe } else if (uploadResult.isSuccess()) { // / success -> silent update of progress notification to success // message - mNotificationBuilder.setOngoing(false).setAutoCancel(true); + mNotificationBuilder + .setOngoing(false) + .setAutoCancel(true) + .setProgress(0, 0, false); /// includes a pending intent in the notification showing the details view of the file Intent showDetailsIntent = null; @@ -781,8 +785,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe // let the user update credentials with one click Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class); updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, upload.getAccount()); - updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ENFORCED_UPDATE, true); - updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_TOKEN); + updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND); @@ -844,6 +847,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe } } + errorBuilder.setContentText(content); mNotificationManager.notify(R.string.uploader_upload_failed_ticker, errorBuilder.build()); }