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

Commit efb69854 authored by Danesh M's avatar Danesh M
Browse files

Blacklist : Strip extension from number

Contacts with extensions in their numbers, fail to be blacklisted.
This resolves the issue.

Depends on : http://review.cyanogenmod.org/#/c/76298/1

Change-Id: I94f848e64972083ef8ddb728379953f788f418f3
parent 6d422e55
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.dialer.lookup.LookupCache;
import com.android.dialer.service.CachedNumberLookupService;
import com.android.dialer.service.CachedNumberLookupService.CachedContactInfo;
import com.android.dialerbind.ObjectFactory;
import com.android.i18n.phonenumbers.PhoneNumberUtil;
import com.android.internal.telephony.util.BlacklistUtils;

import org.json.JSONException;
@@ -281,6 +282,7 @@ public class ContactInfoHelper {
     * @param number the number to be blacklisted
     */
    public void addNumberToBlacklist(String number) {
        number = PhoneNumberUtil.getInstance().stripExtension(number);
        if (BlacklistUtils.addOrUpdate(mContext, number,
                BlacklistUtils.BLOCK_CALLS, BlacklistUtils.BLOCK_CALLS)) {
            // Give the user some feedback
@@ -295,6 +297,7 @@ public class ContactInfoHelper {
     * @param number the number to be blacklisted
     */
    public void removeNumberFromBlacklist(String number) {
        number = PhoneNumberUtil.getInstance().stripExtension(number);
        if (BlacklistUtils.addOrUpdate(mContext, number,
                BlacklistUtils.MATCH_NONE, BlacklistUtils.BLOCK_CALLS)) {
            // Give the user some feedback