mirror of
https://github.com/etesync/android
synced 2025-02-08 21:52:47 +00:00
Syncmanager: use the journalId as the unique collection id.
This commit is contained in:
parent
1e6fc5a9cb
commit
4004eca762
@ -45,7 +45,7 @@ public class CalendarSyncManager extends SyncManager {
|
|||||||
final private HttpUrl remote;
|
final private HttpUrl remote;
|
||||||
|
|
||||||
public CalendarSyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, SyncResult result, LocalCalendar calendar, HttpUrl remote) throws InvalidAccountException {
|
public CalendarSyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, SyncResult result, LocalCalendar calendar, HttpUrl remote) throws InvalidAccountException {
|
||||||
super(context, account, settings, extras, authority, result, "calendar/" + calendar.getId(), CollectionInfo.Type.CALENDAR);
|
super(context, account, settings, extras, authority, result, calendar.getName(), CollectionInfo.Type.CALENDAR);
|
||||||
localCollection = calendar;
|
localCollection = calendar;
|
||||||
this.remote = remote;
|
this.remote = remote;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class ContactsSyncManager extends SyncManager {
|
|||||||
final private CollectionInfo info;
|
final private CollectionInfo info;
|
||||||
|
|
||||||
public ContactsSyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, ContentProviderClient provider, SyncResult result, HttpUrl principal, CollectionInfo info) throws InvalidAccountException {
|
public ContactsSyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, ContentProviderClient provider, SyncResult result, HttpUrl principal, CollectionInfo info) throws InvalidAccountException {
|
||||||
super(context, account, settings, extras, authority, result, "addressBook", CollectionInfo.Type.ADDRESS_BOOK);
|
super(context, account, settings, extras, authority, result, info.url, CollectionInfo.Type.ADDRESS_BOOK);
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
this.remote = principal;
|
this.remote = principal;
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
@ -52,7 +52,7 @@ import static com.etesync.syncadapter.Constants.KEY_ACCOUNT;
|
|||||||
|
|
||||||
abstract public class SyncManager {
|
abstract public class SyncManager {
|
||||||
protected final NotificationHelper notificationManager;
|
protected final NotificationHelper notificationManager;
|
||||||
protected final String uniqueCollectionId;
|
protected final String journalUid;
|
||||||
|
|
||||||
protected final Context context;
|
protected final Context context;
|
||||||
protected final Account account;
|
protected final Account account;
|
||||||
@ -92,7 +92,7 @@ abstract public class SyncManager {
|
|||||||
private List<LocalResource> localDeleted;
|
private List<LocalResource> localDeleted;
|
||||||
private LocalResource[] localDirty;
|
private LocalResource[] localDirty;
|
||||||
|
|
||||||
public SyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, SyncResult syncResult, String uniqueCollectionId, CollectionInfo.Type serviceType) throws InvalidAccountException {
|
public SyncManager(Context context, Account account, AccountSettings settings, Bundle extras, String authority, SyncResult syncResult, String journalUid, CollectionInfo.Type serviceType) throws InvalidAccountException {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.account = account;
|
this.account = account;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
@ -105,8 +105,8 @@ abstract public class SyncManager {
|
|||||||
httpClient = HttpClient.create(context, account);
|
httpClient = HttpClient.create(context, account);
|
||||||
|
|
||||||
// dismiss previous error notifications
|
// dismiss previous error notifications
|
||||||
this.uniqueCollectionId = uniqueCollectionId;
|
this.journalUid = journalUid;
|
||||||
notificationManager = new NotificationHelper(context, uniqueCollectionId, notificationId());
|
notificationManager = new NotificationHelper(context, journalUid, notificationId());
|
||||||
notificationManager.cancel();
|
notificationManager.cancel();
|
||||||
|
|
||||||
data = ((App) context.getApplicationContext()).getData();
|
data = ((App) context.getApplicationContext()).getData();
|
||||||
|
Loading…
Reference in New Issue
Block a user