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

Commit f7b8b342 authored by Hall Liu's avatar Hall Liu Committed by The Android Automerger
Browse files

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
parent 2e11a63a
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;
@@ -1077,6 +1078,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;
        }