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

Commit 88d0c791 authored by yinxu's avatar yinxu
Browse files

UiccProfile should handle responses after disposed

UiccProfile exposes the command interface. Whenever any response
messages are received after the UiccProfile is disposed, those messages
should be handled because the users who sent the requests may still be
waiting for those responses.

Bug:73950003
Test: Unit Test
Change-Id: I4e7f757974d9c0365efe0ee593b9d74ed2e04775
Merged-in: I4e7f757974d9c0365efe0ee593b9d74ed2e04775
(cherry picked from commit 03ee5f77)
parent 7b9fe52f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -157,7 +157,13 @@ public class UiccProfile extends IccCard {
    public final Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            if (mDisposed) {
            // We still need to handle the following response messages even the UiccProfile has been
            // disposed because whoever sent the request may be still waiting for the response.
            if (mDisposed && msg.what != EVENT_OPEN_LOGICAL_CHANNEL_DONE
                    && msg.what != EVENT_CLOSE_LOGICAL_CHANNEL_DONE
                    && msg.what != EVENT_TRANSMIT_APDU_LOGICAL_CHANNEL_DONE
                    && msg.what != EVENT_TRANSMIT_APDU_BASIC_CHANNEL_DONE
                    && msg.what != EVENT_SIM_IO_DONE) {
                loge("handleMessage: Received " + msg.what
                        + " after dispose(); ignoring the message");
                return;