diff options
Diffstat (limited to 'tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java')
-rw-r--r-- | tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java index c5f20e39a4..465880aa7d 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java @@ -2211,7 +2211,6 @@ public class GsmCdmaPhoneTest extends TelephonyTest { verify(mMockCi, times(1)).setNullCipherAndIntegrityEnabled(anyBoolean(), any(Message.class)); - // Some ephemeral error occurred in the modem, but the feature was supported mPhoneUT.sendMessage(mPhoneUT.obtainMessage(EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE, new AsyncResult(null, null, new CommandException(CommandException.Error.REQUEST_NOT_SUPPORTED)))); @@ -2220,6 +2219,28 @@ public class GsmCdmaPhoneTest extends TelephonyTest { } @Test + public void testHandleNullCipherAndIntegrityEnabled_radioUnavailable() { + DeviceConfig.setProperty(DeviceConfig.NAMESPACE_CELLULAR_SECURITY, + TelephonyManager.PROPERTY_ENABLE_NULL_CIPHER_TOGGLE, Boolean.TRUE.toString(), + false); + mPhoneUT.mCi = mMockCi; + assertFalse(mPhoneUT.isNullCipherAndIntegritySupported()); + + mPhoneUT.sendMessage(mPhoneUT.obtainMessage(EVENT_RADIO_AVAILABLE, + new AsyncResult(null, new int[]{ServiceState.RIL_RADIO_TECHNOLOGY_GSM}, null))); + processAllMessages(); + + verify(mMockCi, times(1)).setNullCipherAndIntegrityEnabled(anyBoolean(), + any(Message.class)); + + mPhoneUT.sendMessage(mPhoneUT.obtainMessage(EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE, + new AsyncResult(null, null, + new CommandException(CommandException.Error.RADIO_NOT_AVAILABLE)))); + processAllMessages(); + assertFalse(mPhoneUT.isNullCipherAndIntegritySupported()); + } + + @Test public void testHandleNullCipherAndIntegrityEnabled_radioSupportsFeature() { DeviceConfig.setProperty(DeviceConfig.NAMESPACE_CELLULAR_SECURITY, TelephonyManager.PROPERTY_ENABLE_NULL_CIPHER_TOGGLE, Boolean.TRUE.toString(), @@ -2234,7 +2255,6 @@ public class GsmCdmaPhoneTest extends TelephonyTest { verify(mMockCi, times(1)).setNullCipherAndIntegrityEnabled(anyBoolean(), any(Message.class)); - // Some ephemeral error occurred in the modem, but the feature was supported mPhoneUT.sendMessage(mPhoneUT.obtainMessage(EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE, new AsyncResult(null, null, null))); processAllMessages(); |