summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Takada <yusuke.x.takada@sony.com>2018-06-29 11:01:52 +0900
committerMasaya Nemoto <Masaya.Nemoto@sony.com>2018-09-25 14:12:25 +0900
commite6d42fa3882236a929c353c835fa01b227b490d2 (patch)
treed6b4a5919ad8ad364fc3a887be3c86802e58b59c
parentc499afb74fc17108957791157cd9faa824575fc3 (diff)
downloadBlockedNumberProvider-e6d42fa3882236a929c353c835fa01b227b490d2.tar.gz
Currently "Call Blocking disabled" notification is shown only when any setting of "Enhanced Blocked number" is enabled, and it's not shown even if only "blocked number" is enabled. Since block suppression timer is always set when making emergency call, the notification also should be always shown regardless of setting of Enhanced Blocked numbers. Therefore, we add CarrierConfig to show notification(Call Blocking disabled) always when emergency call. Test: manual - Verified behavior about Block numbers settings Test: auto - Passed BlockedNumberProviderTest Bug: 115697577 Change-Id: I874a967e66eda38fa8c27e792b13139e917e8947
-rw-r--r--src/com/android/providers/blockednumber/BlockedNumberProvider.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/providers/blockednumber/BlockedNumberProvider.java b/src/com/android/providers/blockednumber/BlockedNumberProvider.java
index 69291ff..864f08a 100644
--- a/src/com/android/providers/blockednumber/BlockedNumberProvider.java
+++ b/src/com/android/providers/blockednumber/BlockedNumberProvider.java
@@ -531,23 +531,33 @@ public class BlockedNumberProvider extends ContentProvider {
private boolean shouldShowEmergencyCallNotification() {
return isEnhancedCallBlockingEnabledByPlatform()
- && isAnyEnhancedBlockingSettingEnabled()
+ && (isShowCallBlockingDisabledNotificationAlways()
+ || isAnyEnhancedBlockingSettingEnabled())
&& getBlockSuppressionStatus().isSuppressed
&& getEnhancedBlockSetting(
SystemContract.ENHANCED_SETTING_KEY_SHOW_EMERGENCY_CALL_NOTIFICATION);
}
- private boolean isEnhancedCallBlockingEnabledByPlatform() {
+ private PersistableBundle getCarrierConfig() {
CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(
Context.CARRIER_CONFIG_SERVICE);
PersistableBundle carrierConfig = configManager.getConfig();
if (carrierConfig == null) {
carrierConfig = configManager.getDefaultConfig();
}
- return carrierConfig.getBoolean(
+ return carrierConfig;
+ }
+
+ private boolean isEnhancedCallBlockingEnabledByPlatform() {
+ return getCarrierConfig().getBoolean(
CarrierConfigManager.KEY_SUPPORT_ENHANCED_CALL_BLOCKING_BOOL);
}
+ private boolean isShowCallBlockingDisabledNotificationAlways() {
+ return getCarrierConfig().getBoolean(
+ CarrierConfigManager.KEY_SHOW_CALL_BLOCKING_DISABLED_NOTIFICATION_ALWAYS_BOOL);
+ }
+
private boolean isAnyEnhancedBlockingSettingEnabled() {
return getEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_UNREGISTERED)
|| getEnhancedBlockSetting(SystemContract.ENHANCED_SETTING_KEY_BLOCK_PRIVATE)