Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3abe9de authored by Sarmad Hashmi's avatar Sarmad Hashmi
Browse files

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
parent 9d7067df
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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) {
+0 −1
Original line number Diff line number Diff line
@@ -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;
        }