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

Commit f3c74cef authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Blacklist: fix NPE"

parents 6ee0d233 53d95015
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -468,6 +468,13 @@ final class Call implements CreateConnectionResponse {
        return mCallerInfo == null ? null : mCallerInfo.name;
    }

    String getNumber() {
        if (mCallerInfo != null) {
            return mCallerInfo.phoneNumber;
        }
        return mHandle == null ? null : mHandle.getSchemeSpecificPart();
    }

    Bitmap getPhotoIcon() {
        return mCallerInfo == null ? null : mCallerInfo.cachedPhotoIcon;
    }
+5 −2
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;

import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyProperties;
@@ -2016,7 +2015,11 @@ public final class CallsManager extends Call.ListenerBase {
    }

    protected boolean isCallBlacklisted(Call c) {
        final String number = c.getCallerInfo().phoneNumber;
        final String number = c.getNumber();
        if (number == null) {
            return false;
        }

        // See if the number is in the blacklist
        // Result is one of: MATCH_NONE, MATCH_LIST or MATCH_REGEX
        int listType = BlacklistUtils.isListed(mContext, number, BlacklistUtils.BLOCK_CALLS);