Merge "Resist SIM logical channel leaking when clients crash" am: d66bcb58b6
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telephony/+/2039345
Change-Id: I8f2004b084389fcea6e54d99ffa40c8bf4ee5c54
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 51540b3..fdc1f1f 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -749,6 +749,12 @@
}
openChannelResp = new IccOpenLogicalChannelResponse(channelId,
IccOpenLogicalChannelResponse.STATUS_NO_ERROR, selectResponse);
+
+ uiccPort = getUiccPortFromRequest(request);
+ IccLogicalChannelRequest channelRequest =
+ (IccLogicalChannelRequest) request.argument;
+ channelRequest.channel = channelId;
+ uiccPort.onLogicalChannelOpened(channelRequest);
} else {
if (ar.result == null) {
loge("iccOpenLogicalChannel: Empty response");
@@ -791,6 +797,9 @@
request = (MainThreadRequest) ar.userObj;
if (ar.exception == null) {
request.result = true;
+ uiccPort = getUiccPortFromRequest(request);
+ final int channelId = (Integer) request.argument;
+ uiccPort.onLogicalChannelClosed(channelId);
} else {
request.result = false;
if (ar.exception instanceof CommandException) {