Disable respond via sms feature based on config
Disable Respond via sms feature for incoming call
if config_reject_call_via_sms_enabled is set to false.
Change-Id: I473df978f0494e9830c718529b8fc13ea5dc126e
CRs-Fixed: 771780
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 995c236..b86d658 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -40,6 +40,7 @@
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
+import com.android.internal.telephony.ConfigResourceUtil;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telecom.IVideoProvider;
import com.android.internal.telephony.CallerInfo;
@@ -331,6 +332,8 @@
private boolean mIsLocallyDisconnecting = false;
+ private ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();
+
/**
* Persists the specified parameters and initializes the new instance.
*
@@ -1347,6 +1350,12 @@
return false;
}
+ if (!mConfigResUtil.getBooleanValue(mContext,
+ "config_reject_call_via_sms_enabled")) {
+ //"Respond via SMS" feature is disabled by the above config.
+ return false;
+ }
+
if (PhoneNumberUtils.isUriNumber(getHandle().toString())) {
// The incoming number is actually a URI (i.e. a SIP address),
// not a regular PSTN phone number, and we can't send SMSes to