Merge "FPII-1829:DO NOT MERGE - Restrict ability to add call based on device provision status" into fp/fp2_5.1_int
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 7ecc5e3..efcaa78 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -25,6 +25,7 @@
 import android.os.SystemProperties;
 
 import android.provider.CallLog.Calls;
+import android.provider.Settings;
 import android.telecom.AudioState;
 import android.telecom.CallState;
 import android.telecom.Conference;
@@ -1117,6 +1118,16 @@
      */
     boolean canAddCall() {
         int count = 0;
+
+        /* prevents the ability to launch a dialer instance
+           from an ongoing call on an unprovisioned device. */
+        boolean isDeviceProvisioned = Settings.Global.getInt(mContext.getContentResolver(),
+                Settings.Global.DEVICE_PROVISIONED, 0) != 0;
+        if (!isDeviceProvisioned) {
+            Log.d(TAG, "Device not provisioned, canAddCall is false.");
+            return false;
+        }
+
         for (Call call : mCalls) {
             if (call.isEmergencyCall()) {
                 // We never support add call if one of the calls is an emergency call.