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

Commit 0044d82f authored by Hall Liu's avatar Hall Liu Committed by Santos Cordon
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 453749fa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.provider.CallLog.Calls;
import android.provider.Settings;
import android.telecom.AudioState;
import android.telecom.CallState;
import android.telecom.DisconnectCause;
@@ -833,6 +834,13 @@ public final class CallsManager extends Call.ListenerBase {
     * @return Whether the add-call feature should be enabled for the call.
     */
    protected boolean isAddCallCapable(Call call) {
        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 (call.getParentCall() != null) {
            // Never true for child calls.
            return false;