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

Unverified Commit 111e6ddd authored by You Kim's avatar You Kim Committed by Michael Bestas
Browse files

Fix incorrect key in Maps

IncallController.mInCallServices: InCallServiceInfo
ConnectionServiceRepository.mServiceCache: Pair<ComponentName, UserHandle>

Change-Id: Id0bfca83c5eb2e704ebe5d87bb425252a84532cf
parent 506f61a1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ public class ConnectionServiceRepository {
                @Override
                public void onUnbind(ConnectionServiceWrapper service) {
                    synchronized (mLock) {
                        mServiceCache.remove(service.getComponentName());
                        Pair<ComponentName, UserHandle> cacheKey =
                                Pair.create(service.getComponentName(), service.getUserHandle());
                        mServiceCache.remove(cacheKey);
                    }
                }
            };
+5 −5
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public final class InCallController extends CallsManagerListenerBase {
        }

        protected void onDisconnected() {
            InCallController.this.onDisconnected(mInCallServiceInfo.getComponentName());
            InCallController.this.onDisconnected(mInCallServiceInfo);
            disconnect();  // Unbind explicitly if we get disconnected.
            if (mListener != null) {
                mListener.onDisconnect(InCallServiceBindingConnection.this);
@@ -1132,12 +1132,12 @@ public final class InCallController extends CallsManagerListenerBase {
    /**
     * Cleans up an instance of in-call app after the service has been unbound.
     *
     * @param disconnectedComponent The {@link ComponentName} of the service which disconnected.
     * @param disconnectedServiceInfo The {@link InCallServiceInfo} of the service which disconnected.
     */
    private void onDisconnected(ComponentName disconnectedComponent) {
        Log.i(this, "onDisconnected from %s", disconnectedComponent);
    private void onDisconnected(InCallServiceInfo disconnectedServiceInfo) {
        Log.i(this, "onDisconnected from %s", disconnectedServiceInfo);

        mInCallServices.remove(disconnectedComponent);
        mInCallServices.remove(disconnectedServiceInfo);
    }

    /**
+5 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ abstract class ServiceBinder {
    private ServiceConnection mServiceConnection;

    /** {@link UserHandle} to use for binding, to support work profiles and multi-user. */
    private UserHandle mUserHandle;
    private final UserHandle mUserHandle;

    /** The binder provided by {@link ServiceConnection#onServiceConnected} */
    private IBinder mBinder;
@@ -268,6 +268,10 @@ abstract class ServiceBinder {
        return mComponentName;
    }

    final UserHandle getUserHandle() {
        return mUserHandle;
    }

    @VisibleForTesting
    public boolean isServiceValid(String actionName) {
        if (mBinder == null) {