mirror of
https://github.com/etesync/android
synced 2024-11-18 14:18:05 +00:00
Fix problem of recent commit with deleting local records
This commit is contained in:
parent
44bdd4d0ed
commit
9d76d57af8
@ -325,8 +325,6 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
// delete all entries
|
// delete all entries
|
||||||
where = entryColumnRemoteName() + " IS NOT NULL";
|
where = entryColumnRemoteName() + " IS NOT NULL";
|
||||||
|
|
||||||
Log.d(TAG, "deleteAllExceptRemoteNames: " + where);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (entryColumnParentID() != null)
|
if (entryColumnParentID() != null)
|
||||||
// entries have a parent collection (for instance, events which have a calendar)
|
// entries have a parent collection (for instance, events which have a calendar)
|
||||||
@ -337,7 +335,7 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
);
|
);
|
||||||
else
|
else
|
||||||
// entries don't have a parent collection (contacts are stored directly and not within an address book)
|
// entries don't have a parent collection (contacts are stored directly and not within an address book)
|
||||||
return providerClient.delete(entriesURI(), null, null);
|
return providerClient.delete(entriesURI(), where, null);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new LocalStorageException("Couldn't delete local resources", e);
|
throw new LocalStorageException("Couldn't delete local resources", e);
|
||||||
}
|
}
|
||||||
@ -378,7 +376,7 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
affected += result.count;
|
affected += result.count;
|
||||||
else if (result.uri != null)
|
else if (result.uri != null)
|
||||||
affected = 1;
|
affected = 1;
|
||||||
Log.d(TAG, "... " + affected + " row(s) affected");
|
Log.d(TAG, "... " + affected + " record(s) affected");
|
||||||
pendingOperations.clear();
|
pendingOperations.clear();
|
||||||
} catch(OperationApplicationException | RemoteException ex) {
|
} catch(OperationApplicationException | RemoteException ex) {
|
||||||
throw new LocalStorageException(ex);
|
throw new LocalStorageException(ex);
|
||||||
|
Loading…
Reference in New Issue
Block a user