diff options
Diffstat (limited to 'java/com/android/voicemail/impl/sync')
-rw-r--r-- | java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java | 2 | ||||
-rw-r--r-- | java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java index c255019fc..2c706d2a8 100644 --- a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java +++ b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java @@ -180,7 +180,7 @@ public class OmtpVvmSyncService { // The number of voicemails that exceed our threshold and should be deleted from the server int numVoicemails = imapHelper.getOccuupiedQuota() - - ((int) AUTO_DELETE_ARCHIVE_VM_THRESHOLD * imapHelper.getTotalQuota()); + - (int) (AUTO_DELETE_ARCHIVE_VM_THRESHOLD * imapHelper.getTotalQuota()); List<Voicemail> oldestVoicemails = mQueryHelper.oldestVoicemailsOnServer(numVoicemails); if (!oldestVoicemails.isEmpty()) { mQueryHelper.markArchivedInDatabase(oldestVoicemails); diff --git a/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java b/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java index d129406ff..fc8119a80 100644 --- a/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java +++ b/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java @@ -272,14 +272,15 @@ public class VoicemailsQueryHelper { String sortAndLimit = "date ASC limit " + numVoicemails; try (Cursor cursor = - mContentResolver.query(mSourceUri, null, ARCHIVED_SELECTION, null, sortAndLimit)) { + mContentResolver.query(mSourceUri, PROJECTION, ARCHIVED_SELECTION, null, sortAndLimit)) { Assert.isNotNull(cursor); List<Voicemail> voicemails = new ArrayList<>(); while (cursor.moveToNext()) { + final long id = cursor.getLong(_ID); final String sourceData = cursor.getString(SOURCE_DATA); - Voicemail voicemail = Voicemail.createForUpdate(cursor.getLong(_ID), sourceData).build(); + Voicemail voicemail = Voicemail.createForUpdate(id, sourceData).build(); voicemails.add(voicemail); } |