Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dff32f2e authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

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 am: 71805807 am: a7747ae1
am: 92d73454

* commit '92d73454':
  DO NOT MERGE - Restrict ability to add call based on device provision status
parents 3cd83508 92d73454
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Looper;
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;
@@ -1092,6 +1093,13 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx
     * 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;
        }