Add CTS test for new TelephonyManager API.
Add CTS test for new @SystemApi methods exposed for mainline module.
Bug: 155116650
Test: atest TelephonyManagerTest
Change-Id: I349696479219753d88b57e317b21c4ec495a2761
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
index 0fbfdd1..1167235 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
@@ -2506,6 +2506,28 @@
}
@Test
+ public void testIsIccLockEnabled() {
+ if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+ return;
+ }
+ // verify SecurityException
+ try {
+ mTelephonyManager.isIccLockEnabled();
+ fail("testIsIccLockEnabled: Expected SecurityException on isIccLockEnabled");
+ } catch (SecurityException se) {
+ // expected
+ }
+
+ // test with permission
+ try {
+ ShellIdentityUtils.invokeMethodWithShellPermissions(
+ mTelephonyManager, (tm) -> tm.isIccLockEnabled());
+ } catch (SecurityException se) {
+ fail("testIsIccLockEnabled: SecurityException not expected");
+ }
+ }
+
+ @Test
public void testIsDataEnabledForApn() {
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
return;