[RESTRICT AUTOMERGE] Close the logical channel after opening it

The test case android.telephony4.cts.SimReswstrictedApisTest#testIccOpenLogicalChannel
is supposed to fail so that no logical channel will be opened. However, if under any
circumstances this test doesn't fail, we need to make sure the opened logical channel
is closed.

Bug: 123239506
Test: run cts --module CtsTelephonyTestCases
Change-Id: I5f7365ea8f01840e3d860e1596bd4a7efea06f7d
diff --git a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
index 0f09314..61c02db 100644
--- a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
@@ -89,7 +89,8 @@
     public void testIccOpenLogicalChannel() {
         try {
             if (isSimCardPresent()) {
-                TelephonyManager.getDefault().iccOpenLogicalChannel("");
+                TelephonyManager.getDefault().iccCloseLogicalChannel(
+                        TelephonyManager.getDefault().iccOpenLogicalChannel("").getChannel());
                 fail("Expected SecurityException. App doesn't have carrier privileges.");
             }
         } catch (SecurityException expected) {