1
0
зеркало из https://github.com/etesync/android synced 2025-07-01 04:12:46 +00:00

Sync error notifications: only have one notification for refersh collections.

We were showing an error per sync type, now they are shared.
Этот коммит содержится в:
Tom Hacohen 2020-09-10 11:29:08 +03:00
родитель d260d7699a
Коммит 44c29b4bcd
6 изменённых файлов: 3 добавлений и 14 удалений

Просмотреть файл

@ -33,9 +33,6 @@ class AddressBooksSyncAdapterService : SyncAdapterService() {
private class AddressBooksSyncAdapter(context: Context) : SyncAdapterService.SyncAdapter(context) {
override val syncErrorTitle = R.string.sync_error_contacts
override val notificationManager = SyncNotification(context, "journals-contacts", Constants.NOTIFICATION_CONTACTS_SYNC)
override fun onPerformSyncDo(account: Account, extras: Bundle, authority: String, provider: ContentProviderClient, syncResult: SyncResult) {
val contactsProvider = context.contentResolver.acquireContentProviderClient(ContactsContract.AUTHORITY)
if (contactsProvider == null) {

Просмотреть файл

@ -29,9 +29,6 @@ class CalendarsSyncAdapterService : SyncAdapterService() {
private class SyncAdapter(context: Context) : SyncAdapterService.SyncAdapter(context) {
override val syncErrorTitle = R.string.sync_error_calendar
override val notificationManager = SyncNotification(context, "journals-calendar", Constants.NOTIFICATION_CALENDAR_SYNC)
override fun onPerformSyncDo(account: Account, extras: Bundle, authority: String, provider: ContentProviderClient, syncResult: SyncResult) {
val settings = AccountSettings(context, account)
if (!extras.containsKey(ContentResolver.SYNC_EXTRAS_MANUAL) && !checkSyncConditions(settings))

Просмотреть файл

@ -27,9 +27,6 @@ class ContactsSyncAdapterService : SyncAdapterService() {
private class ContactsSyncAdapter(context: Context) : SyncAdapterService.SyncAdapter(context) {
override val syncErrorTitle = R.string.sync_error_contacts
override val notificationManager = SyncNotification(context, "journals-contacts", Constants.NOTIFICATION_CONTACTS_SYNC)
override fun onPerformSyncDo(account: Account, extras: Bundle, authority: String, provider: ContentProviderClient, syncResult: SyncResult) {
val addressBook = LocalAddressBook(context, account, provider)

Просмотреть файл

@ -99,8 +99,8 @@ abstract class SyncAdapterService : Service() {
}
abstract class SyncAdapter(context: Context) : AbstractThreadedSyncAdapter(context, false) {
abstract val syncErrorTitle: Int
abstract val notificationManager: SyncNotification
private val syncErrorTitle: Int = R.string.sync_error_generic
private val notificationManager = SyncNotification(context, "refresh-collections", Constants.NOTIFICATION_REFRESH_COLLECTIONS)
abstract fun onPerformSyncDo(account: Account, extras: Bundle, authority: String, provider: ContentProviderClient, syncResult: SyncResult)

Просмотреть файл

@ -39,9 +39,6 @@ class TasksSyncAdapterService: SyncAdapterService() {
context: Context,
private val name: ProviderName
): SyncAdapter(context) {
override val syncErrorTitle = R.string.sync_error_tasks
override val notificationManager = SyncNotification(context, "journals-tasks", Constants.NOTIFICATION_TASK_SYNC)
override fun onPerformSyncDo(account: Account, extras: Bundle, authority: String, provider: ContentProviderClient, syncResult: SyncResult) {
val taskProvider = TaskProvider.fromProviderClient(context, provider, name)

Просмотреть файл

@ -363,6 +363,7 @@
<string name="debug_info_more_data_shared">Clicking share will open the email app with the data below, as well as some additional debug information, attached. It may contain some sensitive information, so please review it before sending.</string>
<string name="sync_error_permissions">EteSync permissions</string>
<string name="sync_error_permissions_text">Additional permissions required</string>
<string name="sync_error_generic">Sync failed (%s)</string>
<string name="sync_error_calendar">Calendar sync failed (%s)</string>
<string name="sync_error_contacts">Contacts sync failed (%s)</string>
<string name="sync_error_tasks">Tasks sync failed (%s)</string>