From: David A. Velasco Date: Thu, 26 Jun 2014 09:21:30 +0000 (+0200) Subject: Updated ticker and title messages for notification of failed synchronization due... X-Git-Tag: oc-android-1.7.0_signed~264^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/41705bd2840cd1747b09e746ca911963573fb8c2?ds=inline;hp=--cc Updated ticker and title messages for notification of failed synchronization due to expired credentials --- 41705bd2840cd1747b09e746ca911963573fb8c2 diff --git a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java index df5c4b77..2ac89835 100644 --- a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -382,15 +382,12 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { */ private void notifyFailedSynchronization() { NotificationCompat.Builder notificationBuilder = createNotificationBuilder(); - notificationBuilder.setTicker(i18n(R.string.sync_fail_ticker)); boolean needsToUpdateCredentials = ( mLastFailedResult != null && ( mLastFailedResult.getCode() == ResultCode.UNAUTHORIZED || mLastFailedResult.isIdPRedirection() ) ); - // TODO put something smart in the contentIntent below for all the possible errors - notificationBuilder.setContentTitle(i18n(R.string.sync_fail_ticker)); if (needsToUpdateCredentials) { // let the user update credentials with one click Intent updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class); @@ -400,12 +397,16 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND); notificationBuilder + .setTicker(i18n(R.string.sync_fail_ticker_unauthorized)) + .setContentTitle(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentIntent(PendingIntent.getActivity( getContext(), (int)System.currentTimeMillis(), updateAccountCredentials, PendingIntent.FLAG_ONE_SHOT )) .setContentText(i18n(R.string.sync_fail_content_unauthorized, getAccount().name)); } else { notificationBuilder + .setTicker(i18n(R.string.sync_fail_ticker)) + .setContentTitle(i18n(R.string.sync_fail_ticker)) .setContentText(i18n(R.string.sync_fail_content, getAccount().name)); }