Merge "Fix to display merge icon on failure."
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