mirror of
https://github.com/etesync/android
synced 2025-05-11 11:28:50 +00:00
throw RecordNotFoundExceptions only when specific records are requested
This commit is contained in:
parent
8a651f135b
commit
f4bb3639e6
@ -144,7 +144,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
Contact c = (Contact)res;
|
Contact c = (Contact)res;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), c.getLocalID()),
|
@Cleanup Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), c.getLocalID()),
|
||||||
new String[] { entryColumnUID(), RawContacts.STARRED }, null, null, null);
|
new String[] { entryColumnUID(), RawContacts.STARRED }, null, null, null);
|
||||||
if (cursor != null && cursor.moveToNext()) {
|
if (cursor != null && cursor.moveToNext()) {
|
||||||
c.setUid(cursor.getString(0));
|
c.setUid(cursor.getString(0));
|
||||||
@ -169,7 +169,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void populateStructuredName(Contact c) throws RemoteException {
|
private void populateStructuredName(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] {
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] {
|
||||||
/* 0 */ StructuredName.DISPLAY_NAME, StructuredName.PREFIX, StructuredName.GIVEN_NAME,
|
/* 0 */ StructuredName.DISPLAY_NAME, StructuredName.PREFIX, StructuredName.GIVEN_NAME,
|
||||||
/* 3 */ StructuredName.MIDDLE_NAME, StructuredName.FAMILY_NAME, StructuredName.SUFFIX,
|
/* 3 */ StructuredName.MIDDLE_NAME, StructuredName.FAMILY_NAME, StructuredName.SUFFIX,
|
||||||
/* 6 */ StructuredName.PHONETIC_GIVEN_NAME, StructuredName.PHONETIC_MIDDLE_NAME, StructuredName.PHONETIC_FAMILY_NAME
|
/* 6 */ StructuredName.PHONETIC_GIVEN_NAME, StructuredName.PHONETIC_MIDDLE_NAME, StructuredName.PHONETIC_FAMILY_NAME
|
||||||
@ -191,7 +191,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populatePhoneNumbers(Contact c) throws RemoteException {
|
protected void populatePhoneNumbers(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Phone.TYPE, Phone.LABEL, Phone.NUMBER },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Phone.TYPE, Phone.LABEL, Phone.NUMBER },
|
||||||
Phone.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Phone.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Phone.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Phone.CONTENT_ITEM_TYPE }, null);
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
@ -268,7 +268,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateEmailAddresses(Contact c) throws RemoteException {
|
protected void populateEmailAddresses(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Email.TYPE, Email.ADDRESS, Email.LABEL },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Email.TYPE, Email.ADDRESS, Email.LABEL },
|
||||||
Email.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Email.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Email.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Email.CONTENT_ITEM_TYPE }, null);
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
@ -306,7 +306,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateOrganization(Contact c) throws RemoteException {
|
protected void populateOrganization(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Organization.COMPANY, Organization.TITLE },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Organization.COMPANY, Organization.TITLE },
|
||||||
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Organization.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Organization.CONTENT_ITEM_TYPE }, null);
|
||||||
if (cursor != null && cursor.moveToNext()) {
|
if (cursor != null && cursor.moveToNext()) {
|
||||||
@ -320,7 +320,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateIMPPs(Contact c) throws RemoteException {
|
protected void populateIMPPs(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Im.DATA, Im.TYPE, Im.LABEL, Im.PROTOCOL, Im.CUSTOM_PROTOCOL },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Im.DATA, Im.TYPE, Im.LABEL, Im.PROTOCOL, Im.CUSTOM_PROTOCOL },
|
||||||
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Im.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Im.CONTENT_ITEM_TYPE }, null);
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
@ -378,7 +378,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateNickname(Contact c) throws RemoteException {
|
protected void populateNickname(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Nickname.NAME },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Nickname.NAME },
|
||||||
Nickname.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Nickname.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Nickname.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Nickname.CONTENT_ITEM_TYPE }, null);
|
||||||
if (cursor != null && cursor.moveToNext())
|
if (cursor != null && cursor.moveToNext())
|
||||||
@ -386,7 +386,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateNote(Contact c) throws RemoteException {
|
protected void populateNote(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Note.NOTE },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Note.NOTE },
|
||||||
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Note.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Note.CONTENT_ITEM_TYPE }, null);
|
||||||
if (cursor != null && cursor.moveToNext())
|
if (cursor != null && cursor.moveToNext())
|
||||||
@ -394,7 +394,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populatePostalAddresses(Contact c) throws RemoteException {
|
protected void populatePostalAddresses(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] {
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] {
|
||||||
/* 0 */ StructuredPostal.FORMATTED_ADDRESS, StructuredPostal.TYPE, StructuredPostal.LABEL,
|
/* 0 */ StructuredPostal.FORMATTED_ADDRESS, StructuredPostal.TYPE, StructuredPostal.LABEL,
|
||||||
/* 3 */ StructuredPostal.STREET, StructuredPostal.POBOX, StructuredPostal.NEIGHBORHOOD,
|
/* 3 */ StructuredPostal.STREET, StructuredPostal.POBOX, StructuredPostal.NEIGHBORHOOD,
|
||||||
/* 6 */ StructuredPostal.CITY, StructuredPostal.REGION, StructuredPostal.POSTCODE,
|
/* 6 */ StructuredPostal.CITY, StructuredPostal.REGION, StructuredPostal.POSTCODE,
|
||||||
@ -430,7 +430,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateURLs(Contact c) throws RemoteException {
|
protected void populateURLs(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { Website.URL },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Website.URL },
|
||||||
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Website.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Website.CONTENT_ITEM_TYPE }, null);
|
||||||
if (cursor != null && cursor.moveToNext())
|
if (cursor != null && cursor.moveToNext())
|
||||||
@ -438,7 +438,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void populateEvents(Contact c) throws RemoteException {
|
protected void populateEvents(Contact c) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(dataURI(), new String[] { CommonDataKinds.Event.TYPE, CommonDataKinds.Event.START_DATE },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { CommonDataKinds.Event.TYPE, CommonDataKinds.Event.START_DATE },
|
||||||
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), CommonDataKinds.Event.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), CommonDataKinds.Event.CONTENT_ITEM_TYPE }, null);
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
|
@ -138,7 +138,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static LocalCalendar[] findAll(Account account, ContentProviderClient providerClient) throws RemoteException {
|
public static LocalCalendar[] findAll(Account account, ContentProviderClient providerClient) throws RemoteException {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(calendarsURI(account),
|
@Cleanup Cursor cursor = providerClient.query(calendarsURI(account),
|
||||||
new String[] { Calendars._ID, Calendars.NAME, COLLECTION_COLUMN_CTAG },
|
new String[] { Calendars._ID, Calendars.NAME, COLLECTION_COLUMN_CTAG },
|
||||||
Calendars.DELETED + "=0 AND " + Calendars.SYNC_EVENTS + "=1", null, null);
|
Calendars.DELETED + "=0 AND " + Calendars.SYNC_EVENTS + "=1", null, null);
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
Event e = (Event)resource;
|
Event e = (Event)resource;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), e.getLocalID()),
|
@Cleanup Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), e.getLocalID()),
|
||||||
new String[] {
|
new String[] {
|
||||||
/* 0 */ Events.TITLE, Events.EVENT_LOCATION, Events.DESCRIPTION,
|
/* 0 */ Events.TITLE, Events.EVENT_LOCATION, Events.DESCRIPTION,
|
||||||
/* 3 */ Events.DTSTART, Events.DTEND, Events.EVENT_TIMEZONE, Events.EVENT_END_TIMEZONE, Events.ALL_DAY,
|
/* 3 */ Events.DTSTART, Events.DTEND, Events.EVENT_TIMEZONE, Events.EVENT_END_TIMEZONE, Events.ALL_DAY,
|
||||||
@ -317,7 +317,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
Uri attendeesUri = Attendees.CONTENT_URI.buildUpon()
|
Uri attendeesUri = Attendees.CONTENT_URI.buildUpon()
|
||||||
.appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true")
|
.appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true")
|
||||||
.build();
|
.build();
|
||||||
@Cleanup("close") Cursor c = providerClient.query(attendeesUri, new String[] {
|
@Cleanup Cursor c = providerClient.query(attendeesUri, new String[] {
|
||||||
/* 0 */ Attendees.ATTENDEE_EMAIL, Attendees.ATTENDEE_NAME, Attendees.ATTENDEE_TYPE,
|
/* 0 */ Attendees.ATTENDEE_EMAIL, Attendees.ATTENDEE_NAME, Attendees.ATTENDEE_TYPE,
|
||||||
/* 3 */ Attendees.ATTENDEE_RELATIONSHIP, Attendees.STATUS
|
/* 3 */ Attendees.ATTENDEE_RELATIONSHIP, Attendees.STATUS
|
||||||
}, Attendees.EVENT_ID + "=?", new String[] { String.valueOf(e.getLocalID()) }, null);
|
}, Attendees.EVENT_ID + "=?", new String[] { String.valueOf(e.getLocalID()) }, null);
|
||||||
@ -377,7 +377,7 @@ public class LocalCalendar extends LocalCollection<Event> {
|
|||||||
Uri remindersUri = Reminders.CONTENT_URI.buildUpon()
|
Uri remindersUri = Reminders.CONTENT_URI.buildUpon()
|
||||||
.appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true")
|
.appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true")
|
||||||
.build();
|
.build();
|
||||||
@Cleanup("close") Cursor c = providerClient.query(remindersUri, new String[] {
|
@Cleanup Cursor c = providerClient.query(remindersUri, new String[] {
|
||||||
/* 0 */ Reminders.MINUTES, Reminders.METHOD
|
/* 0 */ Reminders.MINUTES, Reminders.METHOD
|
||||||
}, Reminders.EVENT_ID + "=?", new String[] { String.valueOf(e.getLocalID()) }, null);
|
}, Reminders.EVENT_ID + "=?", new String[] { String.valueOf(e.getLocalID()) }, null);
|
||||||
while (c != null && c.moveToNext()) {
|
while (c != null && c.moveToNext()) {
|
||||||
|
@ -69,14 +69,18 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
if (entryColumnParentID() != null)
|
if (entryColumnParentID() != null)
|
||||||
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(entriesURI(),
|
@Cleanup Cursor cursor = providerClient.query(entriesURI(),
|
||||||
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
||||||
where, null, null);
|
where, null, null);
|
||||||
LinkedList<T> dirty = new LinkedList<T>();
|
LinkedList<T> dirty = new LinkedList<T>();
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
T resource = findById(cursor.getLong(0), true);
|
long id = cursor.getLong(0);
|
||||||
if (resource != null)
|
try {
|
||||||
|
T resource = findById(id, true);
|
||||||
dirty.add(resource);
|
dirty.add(resource);
|
||||||
|
} catch (RecordNotFoundException e) {
|
||||||
|
Log.w(TAG, "Couldn't load dirty resource: " + ContentUris.appendId(entriesURI().buildUpon(), id), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dirty.toArray(new Resource[0]);
|
return dirty.toArray(new Resource[0]);
|
||||||
} catch(RemoteException ex) {
|
} catch(RemoteException ex) {
|
||||||
@ -89,14 +93,18 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
if (entryColumnParentID() != null)
|
if (entryColumnParentID() != null)
|
||||||
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(entriesURI(),
|
@Cleanup Cursor cursor = providerClient.query(entriesURI(),
|
||||||
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
||||||
where, null, null);
|
where, null, null);
|
||||||
LinkedList<T> deleted = new LinkedList<T>();
|
LinkedList<T> deleted = new LinkedList<T>();
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
T resource = findById(cursor.getLong(0), false);
|
long id = cursor.getLong(0);
|
||||||
if (resource != null)
|
try {
|
||||||
|
T resource = findById(id, false);
|
||||||
deleted.add(resource);
|
deleted.add(resource);
|
||||||
|
} catch (RecordNotFoundException e) {
|
||||||
|
Log.w(TAG, "Couldn't load resource marked for deletion: " + ContentUris.appendId(entriesURI().buildUpon(), id), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return deleted.toArray(new Resource[0]);
|
return deleted.toArray(new Resource[0]);
|
||||||
} catch(RemoteException ex) {
|
} catch(RemoteException ex) {
|
||||||
@ -109,13 +117,14 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
if (entryColumnParentID() != null)
|
if (entryColumnParentID() != null)
|
||||||
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
where += " AND " + entryColumnParentID() + "=" + String.valueOf(getId());
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(entriesURI(),
|
@Cleanup Cursor cursor = providerClient.query(entriesURI(),
|
||||||
new String[] { entryColumnID() },
|
new String[] { entryColumnID() },
|
||||||
where, null, null);
|
where, null, null);
|
||||||
LinkedList<T> fresh = new LinkedList<T>();
|
LinkedList<T> fresh = new LinkedList<T>();
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
T resource = findById(cursor.getLong(0), true);
|
long id = cursor.getLong(0);
|
||||||
if (resource != null) {
|
try {
|
||||||
|
T resource = findById(id, true);
|
||||||
resource.initialize();
|
resource.initialize();
|
||||||
|
|
||||||
// new record: set generated UID + remote file name in database
|
// new record: set generated UID + remote file name in database
|
||||||
@ -126,6 +135,8 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
.build());
|
.build());
|
||||||
|
|
||||||
fresh.add(resource);
|
fresh.add(resource);
|
||||||
|
} catch (RecordNotFoundException e) {
|
||||||
|
Log.w(TAG, "Couldn't load fresh resource: " + ContentUris.appendId(entriesURI().buildUpon(), id), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fresh.toArray(new Resource[0]);
|
return fresh.toArray(new Resource[0]);
|
||||||
@ -136,7 +147,7 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
|
|
||||||
public T findById(long localID, boolean populate) throws LocalStorageException {
|
public T findById(long localID, boolean populate) throws LocalStorageException {
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), localID),
|
@Cleanup Cursor cursor = providerClient.query(ContentUris.withAppendedId(entriesURI(), localID),
|
||||||
new String[] { entryColumnRemoteName(), entryColumnETag() }, null, null, null);
|
new String[] { entryColumnRemoteName(), entryColumnETag() }, null, null, null);
|
||||||
if (cursor != null && cursor.moveToNext()) {
|
if (cursor != null && cursor.moveToNext()) {
|
||||||
T resource = newResource(localID, cursor.getString(0), cursor.getString(1));
|
T resource = newResource(localID, cursor.getString(0), cursor.getString(1));
|
||||||
@ -152,7 +163,7 @@ public abstract class LocalCollection<T extends Resource> {
|
|||||||
|
|
||||||
public T findByRemoteName(String remoteName, boolean populate) throws LocalStorageException {
|
public T findByRemoteName(String remoteName, boolean populate) throws LocalStorageException {
|
||||||
try {
|
try {
|
||||||
@Cleanup("close") Cursor cursor = providerClient.query(entriesURI(),
|
@Cleanup Cursor cursor = providerClient.query(entriesURI(),
|
||||||
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
new String[] { entryColumnID(), entryColumnRemoteName(), entryColumnETag() },
|
||||||
entryColumnRemoteName() + "=?", new String[] { remoteName }, null);
|
entryColumnRemoteName() + "=?", new String[] { remoteName }, null);
|
||||||
if (cursor != null && cursor.moveToNext()) {
|
if (cursor != null && cursor.moveToNext()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user