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

Commit d733a73a authored by xulicheng's avatar xulicheng
Browse files

Remove InCallService after incallservice disconnected



mInCallServices will never be cleared

Test: Build
Change-Id: I7cf168a32a39226c66ad9058a8e59e7fd26d48df
Signed-off-by: default avatarxulicheng <xulicheng@xiaomi.com>
parent d52445de
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ public 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);
@@ -1010,6 +1010,7 @@ public class InCallController extends CallsManagerListenerBase {
            mNonUIInCallServiceConnections.disconnect();
            mNonUIInCallServiceConnections = null;
        }
        mInCallServices.clear();
    }

    /**
@@ -1303,12 +1304,12 @@ public 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 disconnectedInfo The {@link InCallServiceInfo} of the service which disconnected.
     */
    private void onDisconnected(ComponentName disconnectedComponent) {
        Log.i(this, "onDisconnected from %s", disconnectedComponent);
    private void onDisconnected(InCallServiceInfo disconnectedInfo) {
        Log.i(this, "onDisconnected from %s", disconnectedInfo.getComponentName());

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

    /**