diff options
Diffstat (limited to 'src/com/android/dialer/filterednumber/FilteredNumbersUtil.java')
-rw-r--r-- | src/com/android/dialer/filterednumber/FilteredNumbersUtil.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java index 68f262cf9..0e162acfa 100644 --- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java +++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java @@ -19,6 +19,7 @@ import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.os.AsyncTask; +import android.preference.PreferenceManager; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Data; @@ -42,6 +43,8 @@ import com.android.dialer.database.FilteredNumberContract.FilteredNumberColumns; */ public class FilteredNumbersUtil { + private static final String HIDE_BLOCKED_CALLS_PREF_KEY = "hide_blocked_calls"; + public interface CheckForSendToVoicemailContactListener { public void onComplete(boolean hasSendToVoicemailContact); } @@ -213,6 +216,24 @@ public class FilteredNumbersUtil { return isBlocked; } + public static boolean shouldHideBlockedCalls(Context context) { + if (context == null) { + return false; + } + return PreferenceManager.getDefaultSharedPreferences(context) + .getBoolean(FilteredNumbersUtil.HIDE_BLOCKED_CALLS_PREF_KEY, false); + } + + public static void setShouldHideBlockedCalls(Context context, boolean shouldHide) { + if (context == null) { + return; + } + PreferenceManager.getDefaultSharedPreferences(context) + .edit() + .putBoolean(FilteredNumbersUtil.HIDE_BLOCKED_CALLS_PREF_KEY, shouldHide) + .apply(); + } + public static boolean canBlockNumber(Context context, String number) { if (PhoneNumberUtils.isEmergencyNumber(number)) { return false; |