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

Commit 065ae3cd authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/28782407',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/28782407', 'googleplex-android-review.googlesource.com/30237829'] into security-aosp-24Q3-release.

Change-Id: I332f4f7c0f3567f619f62678ced2592b16728a7f
parents ab6428db 4f73f974
Loading
Loading
Loading
Loading
+55 −42
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ import android.telecom.ConnectionService;
import android.telecom.DisconnectCause;
import android.telecom.GatewayInfo;
import android.telecom.Log;
import android.telecom.Logging.Runnable;
import android.telecom.Logging.Session;
import android.telecom.Logging.Runnable;
import android.telecom.ParcelableConference;
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccountHandle;
@@ -116,6 +116,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
    // Pre-allocate space for 2 calls; realistically thats all we should ever need (tm)
    private final Map<Call, ScheduledFuture<?>> mScheduledFutureMap = new ConcurrentHashMap<>(2);
    private AnomalyReporterAdapter mAnomalyReporter = new AnomalyReporterAdapterImpl();

    private final class Adapter extends IConnectionServiceAdapter.Stub {

        @Override
@@ -129,7 +130,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                synchronized (mLock) {
                    logIncoming("handleCreateConnectionComplete %s", callId);
                    Call call = mCallIdMapper.getCall(callId);
                    if (mScheduledFutureMap.containsKey(call)) {
                    if (call != null && mScheduledFutureMap.containsKey(call)) {
                        ScheduledFuture<?> existingTimeout = mScheduledFutureMap.get(call);
                        existingTimeout.cancel(false /* cancelIfRunning */);
                        mScheduledFutureMap.remove(call);
@@ -172,18 +173,18 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
            try {
                synchronized (mLock) {
                    logIncoming("handleCreateConferenceComplete %s", callId);
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null && mScheduledFutureMap.containsKey(call)) {
                        ScheduledFuture<?> existingTimeout = mScheduledFutureMap.get(call);
                        existingTimeout.cancel(false /* cancelIfRunning */);
                        mScheduledFutureMap.remove(call);
                    }
                    // Check status hints image for cross user access
                    if (conference.getStatusHints() != null) {
                        Icon icon = conference.getStatusHints().getIcon();
                        conference.getStatusHints().setIcon(StatusHints.
                                validateAccountIconUserBoundary(icon, callingUserHandle));
                    }
                    Call call = mCallIdMapper.getCall(callId);
                    if (mScheduledFutureMap.containsKey(call)) {
                        ScheduledFuture<?> existingTimeout = mScheduledFutureMap.get(call);
                        existingTimeout.cancel(false /* cancelIfRunning */);
                        mScheduledFutureMap.remove(call);
                    }
                    ConnectionServiceWrapper.this
                            .handleCreateConferenceComplete(callId, request, conference);

@@ -2473,6 +2474,13 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
    @Override
    protected void removeServiceInterface() {
        Log.v(this, "Removing Connection Service Adapter.");
        if (mServiceInterface == null) {
            // In some cases, we may receive multiple calls to
            // remoteServiceInterface, such as when the remote process crashes
            // (onBinderDied & onServiceDisconnected)
            Log.w(this, "removeServiceInterface: mServiceInterface is null");
            return;
        }
        removeConnectionServiceAdapter(mAdapter);
        // We have lost our service connection. Notify the world that this service is done.
        // We must notify the adapter before CallsManager. The adapter will force any pending
@@ -2481,6 +2489,10 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        handleConnectionServiceDeath();
        mCallsManager.handleConnectionServiceDeath(this);
        mServiceInterface = null;
        if (mScheduledExecutor != null) {
            mScheduledExecutor.shutdown();
            mScheduledExecutor = null;
        }
    }

    @Override
@@ -2600,6 +2612,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
            }
        }
        mCallIdMapper.clear();
        mScheduledFutureMap.clear();

        if (mConnSvrFocusListener != null) {
            mConnSvrFocusListener.onConnectionServiceDeath(this);