Expose carrier privilege rules certificates as @TestApi.
With the updated CTS UICC spec added this year, some SIM-dependent CTS tests will need to do runtime inspection of the certificates available to determine which SIM the test is running with. This information may be used to e.g. selectively enable tests only for newer SIMs if they require the updated hardware. Test: make Test: atest CtsCarrierApiTestCases Bug: 178419755 Change-Id: I942d4c0c7c786d7c8b561e5e65773367cefffb31
This commit is contained in:
@@ -2465,6 +2465,7 @@ package android.telephony {
|
||||
public class TelephonyManager {
|
||||
method public int addDevicePolicyOverrideApn(@NonNull android.content.Context, @NonNull android.telephony.data.ApnSetting);
|
||||
method public int getCarrierIdListVersion();
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<java.lang.String> getCertsFromCarrierPrivilegeAccessRules();
|
||||
method @NonNull public java.util.List<android.telephony.data.ApnSetting> getDevicePolicyOverrideApns(@NonNull android.content.Context);
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
|
||||
method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
|
||||
|
||||
@@ -11746,26 +11746,26 @@ public class TelephonyManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of certs in hex string from loaded carrier privileges access rules.
|
||||
* Return a list of certs as hex strings from loaded carrier privileges access rules.
|
||||
*
|
||||
* @return a list of certificate in hex string. return {@code null} if there is no certs
|
||||
* or privilege rules are not loaded yet.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE}
|
||||
* @return a list of certificates as hex strings, or an empty list if there are no certs or
|
||||
* privilege rules are not loaded yet.
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||
@NonNull
|
||||
public List<String> getCertsFromCarrierPrivilegeAccessRules() {
|
||||
List<String> certs = null;
|
||||
try {
|
||||
ITelephony service = getITelephony();
|
||||
if (service != null) {
|
||||
return service.getCertsFromCarrierPrivilegeAccessRules(getSubId());
|
||||
certs = service.getCertsFromCarrierPrivilegeAccessRules(getSubId());
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
// This could happen if binder process crashes.
|
||||
}
|
||||
return null;
|
||||
return certs == null ? Collections.emptyList() : certs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user