diff options
author | Sarmad Hashmi <mhashmi@google.com> | 2016-04-06 20:11:03 -0700 |
---|---|---|
committer | Sarmad Hashmi <mhashmi@google.com> | 2016-04-07 10:27:18 -0700 |
commit | c3abe9de14a20dffbe66665baa85973f41548056 (patch) | |
tree | 7e32dd51d9f458d90ae5f430da8ea78b50630a18 | |
parent | 9d7067df15538b56c9dfc9aacff2802cb651cd0a (diff) |
Fix bug where call cards from private number are blank.
+Revert ag/904832 and add proper fix
+ag/904832 was an incorrect fix for the bug because the
isBlockedNumber method in FilteredNumberAsyncQueryHandler is not
supposed to call onCheckComplete on the listener if the number was
invalid. All callers of the method isBlockedNumber must, in addition to
checking if the result was invalid in the callback, also check the
result of the call to see if it was false.
+This change removes the callback call if the number is invalid and
instead adds a check in CallLogAdapter right after isBlockedNumber is
called to determine if the number was valid. If not, the views are
rendered.
Change-Id: Ib4eaafd38c28afb8acacd94fd6716c4042286968
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 9 | ||||
-rw-r--r-- | src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 506dafdf8..24ec7ced8 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -485,13 +485,11 @@ public class CallLogAdapter extends GroupingListAdapter final String number = c.getString(CallLogQuery.NUMBER); final String countryIso = c.getString(CallLogQuery.COUNTRY_ISO); - - mFilteredNumberAsyncQueryHandler.isBlockedNumber( + final CallLogListItemViewHolder views = (CallLogListItemViewHolder) viewHolder; + boolean success = mFilteredNumberAsyncQueryHandler.isBlockedNumber( new FilteredNumberAsyncQueryHandler.OnCheckBlockedListener() { @Override public void onCheckComplete(Integer id) { - final CallLogListItemViewHolder views = - (CallLogListItemViewHolder) viewHolder; views.blockId = id; if (mExtendedCallInfoService == null) { loadDataAndRender(views); @@ -507,6 +505,9 @@ public class CallLogAdapter extends GroupingListAdapter } } }, number, countryIso); + if (!success) { + loadDataAndRender(views); + } } private void loadDataAndRender(CallLogListItemViewHolder views) { diff --git a/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java b/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java index e3f8c59c4..52ef49ac0 100644 --- a/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java +++ b/src/com/android/dialer/database/FilteredNumberAsyncQueryHandler.java @@ -151,7 +151,6 @@ public class FilteredNumberAsyncQueryHandler extends AsyncQueryHandler { final OnCheckBlockedListener listener, String number, String countryIso) { final String e164Number = PhoneNumberUtils.formatNumberToE164(number, countryIso); if (TextUtils.isEmpty(e164Number)) { - listener.onCheckComplete(null); return false; } |