Loading tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/apdu/ApduSenderTest.java +21 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,11 @@ public class ApduSenderTest { } @After public void tearDown() { public void tearDown() throws InterruptedException { // Send an APDU to verify that the channel lock is not stuck (b/382549728). // Sameas testSend(), but not verifying mMockCi interactions. checkChannelLock(); mHandler.removeCallbacksAndMessages(null); mHandler = null; mLooper = null; Loading Loading @@ -536,4 +540,20 @@ public class ApduSenderTest { .remove(SHARED_PREFS_KEY_CHANNEL_RESPONSE) .apply(); } /** * Send an APDU to verify that the channel lock is not stuck (b/382549728). * Same as testSend(), but not verifying mMockCi interactions. */ private void checkChannelLock() throws InterruptedException { int channel = LogicalChannelMocker.mockOpenLogicalChannelResponse(mMockCi, "9000"); LogicalChannelMocker.mockSendToLogicalChannel(mMockCi, channel, "A1A1A19000"); LogicalChannelMocker.mockCloseLogicalChannel(mMockCi, channel, /* error= */ null); mSender.send((selectResponse, requestBuilder) -> requestBuilder.addApdu( 10, 1, 2, 3, 0, "a"), mResponseCaptor, mHandler); mLooper.processAllMessages(); assertEquals("A1A1A1", IccUtils.bytesToHexString(mResponseCaptor.response)); } } Loading
tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/apdu/ApduSenderTest.java +21 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,11 @@ public class ApduSenderTest { } @After public void tearDown() { public void tearDown() throws InterruptedException { // Send an APDU to verify that the channel lock is not stuck (b/382549728). // Sameas testSend(), but not verifying mMockCi interactions. checkChannelLock(); mHandler.removeCallbacksAndMessages(null); mHandler = null; mLooper = null; Loading Loading @@ -536,4 +540,20 @@ public class ApduSenderTest { .remove(SHARED_PREFS_KEY_CHANNEL_RESPONSE) .apply(); } /** * Send an APDU to verify that the channel lock is not stuck (b/382549728). * Same as testSend(), but not verifying mMockCi interactions. */ private void checkChannelLock() throws InterruptedException { int channel = LogicalChannelMocker.mockOpenLogicalChannelResponse(mMockCi, "9000"); LogicalChannelMocker.mockSendToLogicalChannel(mMockCi, channel, "A1A1A19000"); LogicalChannelMocker.mockCloseLogicalChannel(mMockCi, channel, /* error= */ null); mSender.send((selectResponse, requestBuilder) -> requestBuilder.addApdu( 10, 1, 2, 3, 0, "a"), mResponseCaptor, mHandler); mLooper.processAllMessages(); assertEquals("A1A1A1", IccUtils.bytesToHexString(mResponseCaptor.response)); } }