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

Commit a06c9a4a 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 a31be432
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Trace;
import android.provider.CallLog.Calls;
import android.provider.Settings;
import android.telecom.AudioState;
import android.telecom.CallState;
import android.telecom.Conference;
@@ -950,6 +951,13 @@ public final class CallsManager extends Call.ListenerBase {
     * 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;
        }