summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/util
diff options
context:
space:
mode:
authorRichard MacGregor <rmacgregor@cyngn.com>2016-04-13 17:02:56 -0700
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-14 16:55:18 -0700
commit0e6d8d4bfe506d615d11672a889fbbaa9212cd4b (patch)
tree870fb0e13e881d8f6a36e046e0aa84462e19a15c /src/com/android/contacts/common/util
parent5fdfde44850f18f1289171754b644bd94d01a5b2 (diff)
downloadpackages_apps_ContactsCommon-0e6d8d4bfe506d615d11672a889fbbaa9212cd4b.tar.gz
packages_apps_ContactsCommon-0e6d8d4bfe506d615d11672a889fbbaa9212cd4b.tar.bz2
packages_apps_ContactsCommon-0e6d8d4bfe506d615d11672a889fbbaa9212cd4b.zip
[1/2] Add new method for determining whether to show block option
BlockRequests only work on certain data types. Phone numbers are currently the only type supported. It doesn't make sense to give block action to something that won't get blocked. Ticket CD-461 Change-Id: If3f50f1ee0a4cee2d17fcc33b94eea75099ae561
Diffstat (limited to 'src/com/android/contacts/common/util')
-rw-r--r--src/com/android/contacts/common/util/BlockContactHelper.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/util/BlockContactHelper.java b/src/com/android/contacts/common/util/BlockContactHelper.java
index eff65b6b..e5867b32 100644
--- a/src/com/android/contacts/common/util/BlockContactHelper.java
+++ b/src/com/android/contacts/common/util/BlockContactHelper.java
@@ -112,6 +112,11 @@ public class BlockContactHelper {
return mIsBlacklisted;
}
+ public boolean canBlockContact(Context context) {
+ boolean isBlacklistEnabled = BlacklistUtils.isBlacklistEnabled(context);
+ return isBlacklistEnabled && mBlockRequest != null && mBlockRequest != BlockRequest.EMPTY;
+ }
+
public String getLookupProviderName() {
if (mIsProviderInitialized) {
return mLookupProvider.getDisplayName();