diff options
author | Brandon Maxwell <maxwelb@google.com> | 2016-02-28 15:28:45 -0800 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2016-03-01 10:18:44 -0800 |
commit | f0e0ce60005a5732c65bddf290cd758c517d99db (patch) | |
tree | 6af138b0372d083aa17ed9f13b76104c1b3ba6a7 /src/com | |
parent | 60fb1dc7afe8fe6079785724a21bbffbdb4eac88 (diff) |
Using FilteredNumCompat for unblock
+ This CL updates the FilteredNumberAsyncQueryHandler#unblock methods
to use the FilteredNumberCompat class to properly choose between the
original Dialer blocking implementation and new blocking.
Bug=26664600
Change-Id: I528604eeafa4f7fa131cb1898d57a87708ba58b5
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java b/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java index 7279911ce..7af1a1339 100644 --- a/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java +++ b/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java @@ -115,14 +115,6 @@ public class FilteredNumberAsyncQueryHandler extends AsyncQueryHandler { } } - private static Uri getContentUri(Integer id) { - Uri uri = FilteredNumber.CONTENT_URI; - if (id != null) { - uri = ContentUris.withAppendedId(uri, id); - } - return uri; - } - public final void incrementFilteredCount(Integer id) { // No concept of counts with new filtering if (FilteredNumberCompat.useNewFiltering()) { @@ -228,22 +220,25 @@ public class FilteredNumberAsyncQueryHandler extends AsyncQueryHandler { /** * Unblocks the number with the given id. * - * @param listener The {@link OnUnblockNumberListener} called after the number is unblocked. + * @param listener (optional) The {@link OnUnblockNumberListener} called after the number is + * unblocked. * @param id The id of the number to unblock. */ - public void unblock(final OnUnblockNumberListener listener, Integer id) { + public void unblock(@Nullable final OnUnblockNumberListener listener, Integer id) { if (id == null) { throw new IllegalArgumentException("Null id passed into unblock"); } - unblock(listener, getContentUri(id)); + unblock(listener, FilteredNumberCompat.getContentUri(id)); } /** * Removes row from database. + * @param listener (optional) The {@link OnUnblockNumberListener} called after the number is + * unblocked. * @param uri The uri of row to remove, from - * {@link FilteredNumberAsyncQueryHandler#blockNumber}. + * {@link FilteredNumberAsyncQueryHandler#blockNumber}. */ - public void unblock(final OnUnblockNumberListener listener, final Uri uri) { + public void unblock(@Nullable final OnUnblockNumberListener listener, final Uri uri) { startQuery(NO_TOKEN, new Listener() { @Override public void onQueryComplete(int token, Object cookie, Cursor cursor) { @@ -256,7 +251,7 @@ public class FilteredNumberAsyncQueryHandler extends AsyncQueryHandler { cursor.moveToFirst(); final ContentValues values = new ContentValues(); DatabaseUtils.cursorRowToContentValues(cursor, values); - values.remove(FilteredNumberColumns._ID); + values.remove(FilteredNumberCompat.getIdColumnName()); startDelete(NO_TOKEN, new Listener() { @Override |