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

Commit b4b8bf90 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

am: 0044d82f

* commit '0044d82f':
  DO NOT MERGE - Restrict ability to add call based on device provision status
parents f7622446 0044d82f
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;
@@ -840,6 +841,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;