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

Commit a32a367a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6206568 from e307c046 to rvc-release

Change-Id: Idcd440126ad34b88dcbadf14eb314ee82201293d
parents 8c1e0132 e307c046
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2554,6 +2554,15 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        }
    }

    public void addConferenceParticipants(List<Uri> participants) {
        if (mConnectionService == null) {
            Log.w(this, "adding conference participants without a connection service.");
        } else if (can(Connection.CAPABILITY_ADD_PARTICIPANT)) {
            Log.addEvent(this, LogUtils.Events.ADD_PARTICIPANT);
            mConnectionService.addConferenceParticipants(this, participants);
        }
    }

    /**
     * Initiates a request to the connection service to pull this call.
     * <p>
+2 −2
Original line number Diff line number Diff line
@@ -337,8 +337,8 @@ public final class CallLogManager extends CallsManagerListenerBase {
        int callFeatures = getCallFeatures(call.getVideoStateHistory(),
                call.getDisconnectCause().getCode() == DisconnectCause.CALL_PULLED,
                call.wasHighDefAudio(), call.wasWifi(),
                (call.getConnectionProperties() & Connection.PROPERTY_ASSISTED_DIALING_USED) ==
                        Connection.PROPERTY_ASSISTED_DIALING_USED,
                (call.getConnectionProperties() & Connection.PROPERTY_ASSISTED_DIALING) ==
                        Connection.PROPERTY_ASSISTED_DIALING,
                call.wasEverRttCall(),
                call.wasVolte());

+62 −0
Original line number Diff line number Diff line
@@ -16,9 +16,12 @@

package com.android.server.telecom;

import static android.Manifest.permission.MODIFY_PHONE_STATE;

import android.app.AppOpsManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
@@ -465,6 +468,32 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        public void addConferenceCall(String callId, ParcelableConference parcelableConference,
                Session.Info sessionInfo) {
            Log.startSession(sessionInfo, LogUtils.Sessions.CSW_ADD_CONFERENCE_CALL);

            if (parcelableConference.getConnectElapsedTimeMillis() != 0
                    && mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE)
                            != PackageManager.PERMISSION_GRANTED) {
                Log.w(this, "addConferenceCall from caller without permission!");
                parcelableConference = new ParcelableConference(
                        parcelableConference.getPhoneAccount(),
                        parcelableConference.getState(),
                        parcelableConference.getConnectionCapabilities(),
                        parcelableConference.getConnectionProperties(),
                        parcelableConference.getConnectionIds(),
                        parcelableConference.getVideoProvider(),
                        parcelableConference.getVideoState(),
                        0 /* connectTimeMillis */,
                        0 /* connectElapsedRealTime */,
                        parcelableConference.getStatusHints(),
                        parcelableConference.getExtras(),
                        parcelableConference.getHandle(),
                        parcelableConference.getHandlePresentation(),
                        "" /* callerDisplayName */,
                        TelecomManager.PRESENTATION_UNKNOWN /* callerDisplayNamePresentation */,
                        parcelableConference.getDisconnectCause(),
                        parcelableConference.isRingbackRequested()
                        );
            }

            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -752,6 +781,13 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        public void setAddress(String callId, Uri address, int presentation,
                Session.Info sessionInfo) {
            Log.startSession(sessionInfo, "CSW.sA");

            if (mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE)
                    != PackageManager.PERMISSION_GRANTED) {
                Log.w(this, "setAddress from caller without permission.");
                return;
            }

            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -836,6 +872,13 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                mAppOpsManager.checkPackage(Binder.getCallingUid(),
                        callingPhoneAccountHandle.getComponentName().getPackageName());
            }

            if (mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE)
                    != PackageManager.PERMISSION_GRANTED) {
                Log.w(this, "addExistingConnection from caller without permission!");
                return;
            }

            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -1038,6 +1081,13 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        public void setConferenceState(String callId, boolean isConference,
                Session.Info sessionInfo) throws RemoteException {
            Log.startSession(sessionInfo, "CSW.sCS");

            if (mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE)
                    != PackageManager.PERMISSION_GRANTED) {
                Log.w(this, "setConferenceState from caller without permission.");
                return;
            }

            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -1680,6 +1730,18 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        }
    }

    void addConferenceParticipants(Call call, List<Uri> participants) {
        final String callId = mCallIdMapper.getCallId(call);
        if (callId != null && isServiceValid("addConferenceParticipants")) {
            try {
                logOutgoing("addConferenceParticipants %s", callId);
                mServiceInterface.addConferenceParticipants(callId, participants,
                        Log.getExternalSession());
            } catch (RemoteException ignored) {
            }
        }
    }

    @VisibleForTesting
    public void pullExternalCall(Call call) {
        final String callId = mCallIdMapper.getCallId(call);
+23 −0
Original line number Diff line number Diff line
@@ -473,6 +473,29 @@ class InCallAdapter extends IInCallAdapter.Stub {
        }
    }

    @Override
    public void addConferenceParticipants(String callId, List<Uri> participants) {
        try {
            Log.startSession("ICA.aCP", mOwnerPackageName);
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null) {
                        call.addConferenceParticipants(participants);
                    } else {
                        Log.w(this, "addConferenceParticipants, unknown call id: %s", callId);
                    }
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        } finally {
            Log.endSession();
        }
    }


    @Override
    public void pullExternalCall(String callId) {
        try {
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class LogUtils {
        public static final String CONFERENCE_WITH = "CONF_WITH";
        public static final String SPLIT_FROM_CONFERENCE = "CONF_SPLIT";
        public static final String SWAP = "SWAP";
        public static final String ADD_PARTICIPANT = "ADD_PARTICIPANT";
        public static final String ADD_CHILD = "ADD_CHILD";
        public static final String REMOVE_CHILD = "REMOVE_CHILD";
        public static final String SET_PARENT = "SET_PARENT";
Loading