Android CTS 7.0: CtsCarrierApiTestCases item failed in "testHasCarrierPrivileges"

1.2k Views Asked by At

I am now trying to run the Android CTS 7.0 on Google Nexus 6 (AOS:7). There is an fail in the item "CtsCarrierApiTestCases" The error message is:

android.carrierapi.cts.CarrierApiTest#testHasCarrierPrivileges 
fail
 junit.framework.AssertionFailedError: This test requires a SIM card with carrier privilege rule on it.

We had checked the following Android web page: https://source.android.com/devices/tech/config/uicc.html#prepare_uicc

According to the above link, we need to add the CarrierPrivileges to the UICC card and this has to be done through the Telephone System provider. Unfortunately, till now we do not have the contact to our system provider here in Taiwan. Any chance that we can do this by our won in the lab? We are thinking to buy a card reader and a blank SIM card, could this be a direction?

Any advice is welcome and thanks in advance.

1

There are 1 best solutions below

0
On

I had encountered same issue. Some cts tests are only allowed for system priviledged apps or if app has UICC carrier privileges.

In both options are not availabe, as a workaround, /AOSP/platform/packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java can be tweaked as shown below to disable permission checking in source code. After aplying patch, run "mmm platform/packages/services/Telephony/" followed by "adb remount && adb sync" to update system priviledged app /system/priv-app/TeleService/TeleService.apk. One time device reboot is required afterwards.

 private void enforceModifyPermissionOrCarrierPrivilege(int subId) {
+   log("CTS CarrierPrivilege Allowed Patch");
+     return;
    int permission = mApp.checkCallingOrSelfPermission(