summaryrefslogtreecommitdiff
path: root/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java')
-rw-r--r--tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java b/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
index 9f9301f..3a88a85 100644
--- a/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
+++ b/tests/src/com/android/providers/blockednumber/BlockedNumberProviderTest.java
@@ -364,9 +364,21 @@ public class BlockedNumberProviderTest extends AndroidTestCase {
setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNKNOWN, true);
assertShouldSystemBlock(true, phoneNumber,
createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNKNOWN, false));
+ assertShouldSystemBlock(true, phoneNumber,
+ createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNAVAILABLE, false));
setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNKNOWN, false);
assertShouldSystemBlock(false, phoneNumber,
createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNKNOWN, false));
+ assertShouldSystemBlock(false, phoneNumber,
+ createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNAVAILABLE, false));
+
+ // Check whether block unavailable calls setting works well
+ setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE, true);
+ assertShouldSystemBlock(false, phoneNumber,
+ createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNAVAILABLE, false));
+ setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE, false);
+ assertShouldSystemBlock(false, phoneNumber,
+ createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNAVAILABLE, false));
}
public void testEnhancedBlockSuppressionAfterEmergencyContact() {
@@ -380,6 +392,7 @@ public class BlockedNumberProviderTest extends AndroidTestCase {
setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_PRIVATE, true);
setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_PAYPHONE, true);
setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNKNOWN, true);
+ setEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE, true);
// After emergency contact blocks should be suppressed.
long timestampMillisBeforeEmergencyContact = System.currentTimeMillis();
@@ -393,6 +406,8 @@ public class BlockedNumberProviderTest extends AndroidTestCase {
createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_PAYPHONE, false));
assertShouldSystemBlock(false, phoneNumber,
createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNKNOWN, false));
+ assertShouldSystemBlock(false, phoneNumber,
+ createBundleForEnhancedBlocking(TelecomManager.PRESENTATION_UNAVAILABLE, false));
SystemContract.BlockSuppressionStatus status =
SystemContract.getBlockSuppressionStatus(mMockContext);