Loading src/com/android/contacts/calllog/ContactInfoHelper.java +12 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.contacts.calllog; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.Cursor; Loading @@ -23,6 +24,7 @@ import android.net.Uri; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.PhoneLookup; import android.provider.Settings; import android.provider.Telephony; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.widget.Toast; Loading @@ -37,10 +39,6 @@ public class ContactInfoHelper { private final Context mContext; private final String mCurrentCountryIso; // Blacklist support private static final String INSERT_BLACKLIST = "com.android.phone.INSERT_BLACKLIST"; private static final String BLACKLIST_NUMBER = "number"; public ContactInfoHelper(Context context, String currentCountryIso) { mContext = context; mCurrentCountryIso = currentCountryIso; Loading Loading @@ -227,14 +225,18 @@ public class ContactInfoHelper { * @param number the number to be blacklisted */ public void addNumberToBlacklist(String number) { Intent intent = new Intent(INSERT_BLACKLIST); intent.putExtra(BLACKLIST_NUMBER, number); mContext.sendBroadcast(intent); ContentValues cv = new ContentValues(); cv.put(Telephony.Blacklist.PHONE_MODE, 1); Uri uri = Uri.withAppendedPath(Telephony.Blacklist.CONTENT_FILTER_BYNUMBER_URI, number); int count = mContext.getContentResolver().update(uri, cv, null, null); if (count != 0) { // Give the user some feedback String message = mContext.getString(R.string.toast_added_to_blacklist, number); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } } /** * Checks whether calls can be blacklisted; that is, whether the Loading Loading
src/com/android/contacts/calllog/ContactInfoHelper.java +12 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.contacts.calllog; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.Cursor; Loading @@ -23,6 +24,7 @@ import android.net.Uri; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.PhoneLookup; import android.provider.Settings; import android.provider.Telephony; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.widget.Toast; Loading @@ -37,10 +39,6 @@ public class ContactInfoHelper { private final Context mContext; private final String mCurrentCountryIso; // Blacklist support private static final String INSERT_BLACKLIST = "com.android.phone.INSERT_BLACKLIST"; private static final String BLACKLIST_NUMBER = "number"; public ContactInfoHelper(Context context, String currentCountryIso) { mContext = context; mCurrentCountryIso = currentCountryIso; Loading Loading @@ -227,14 +225,18 @@ public class ContactInfoHelper { * @param number the number to be blacklisted */ public void addNumberToBlacklist(String number) { Intent intent = new Intent(INSERT_BLACKLIST); intent.putExtra(BLACKLIST_NUMBER, number); mContext.sendBroadcast(intent); ContentValues cv = new ContentValues(); cv.put(Telephony.Blacklist.PHONE_MODE, 1); Uri uri = Uri.withAppendedPath(Telephony.Blacklist.CONTENT_FILTER_BYNUMBER_URI, number); int count = mContext.getContentResolver().update(uri, cv, null, null); if (count != 0) { // Give the user some feedback String message = mContext.getString(R.string.toast_added_to_blacklist, number); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } } /** * Checks whether calls can be blacklisted; that is, whether the Loading