Add device config check for "allow hold" carrier config. am: 3b758788e8 am: bfb66641e1
am: 608298d979
Change-Id: I899e6594c5856d052d6c92badd5b0fe5ca220ab0
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 3810699..7ad37b0 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -973,7 +973,8 @@
private boolean canHoldImsCalls() {
PersistableBundle b = getCarrierConfig();
// Return true if the CarrierConfig is unavailable
- return b == null || b.getBoolean(CarrierConfigManager.KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL);
+ return !doesDeviceRespectHoldCarrierConfig() || b == null ||
+ b.getBoolean(CarrierConfigManager.KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL);
}
private PersistableBundle getCarrierConfig() {
@@ -985,6 +986,23 @@
}
/**
+ * Determines if the device will respect the value of the
+ * {@link CarrierConfigManager#KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL} configuration option.
+ *
+ * @return {@code false} if the device always supports holding IMS calls, {@code true} if it
+ * will use {@link CarrierConfigManager#KEY_ALLOW_HOLD_IN_IMS_CALL_BOOL} to determine if
+ * hold is supported.
+ */
+ private boolean doesDeviceRespectHoldCarrierConfig() {
+ Phone phone = getPhone();
+ if (phone == null) {
+ return true;
+ }
+ return phone.getContext().getResources().getBoolean(
+ com.android.internal.R.bool.config_device_respects_hold_carrier_config);
+ }
+
+ /**
* Whether the connection should be treated as an emergency.
* @return {@code true} if the connection should be treated as an emergency call based
* on the number dialed, {@code false} otherwise.