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
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 89ec9b5..34d04e3 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.os.Trace;
import android.provider.CallLog.Calls;
+import android.provider.Settings;
import android.telecom.CallAudioState;
import android.telecom.Conference;
import android.telecom.Connection;
@@ -1260,6 +1261,13 @@
* Returns true if telecom supports adding another top-level call.
*/
boolean canAddCall() {
+ 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;
+ }
+
if (getFirstCallWithState(OUTGOING_CALL_STATES) != null) {
return false;
}