FPII-1829:DO NOT MERGE - Restrict ability to add call based on device provision status
DO NOT MERGE - Restrict ability to add call based on device provision status
Always return false for canAddCall if device is not yet provisioned.
Bug: 26303187
Change-Id: I9c4ebc8b954a79562b2ec83d59314a3fb621ddfb
(cherry picked from commit e686427e910406f3f87875dd9aba296385563977)
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.