From 7a545324ffe8c2c2503078966c06f78906300800 Mon Sep 17 00:00:00 2001 From: chen xu Date: Tue, 30 Oct 2018 18:18:43 -0700 Subject: hidden API getCertsFromCarrierPrivilegeAccessRules Bug: 110559381 Test: unit test & manual test Change-Id: I7b2c946f1f4db08e1c071fe6eb9f3771a592fd47 Merged-in: I7b2c946f1f4db08e1c071fe6eb9f3771a592fd47 --- .../java/android/telephony/TelephonyManager.java | 23 ++++++++++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 5 +++++ 2 files changed, 28 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 9af5761354f6..3bf89fa46af2 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -8222,6 +8222,29 @@ public class TelephonyManager { return null; } + /** + * Return a list of certs in hex string 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. + * + *

Requires Permission: + * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE} + * @hide + */ + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + public List getCertsFromCarrierPrivilegeAccessRules() { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getCertsFromCarrierPrivilegeAccessRules(getSubId()); + } + } catch (RemoteException ex) { + // This could happen if binder process crashes. + } + return null; + } + /** * Return the application ID for the uicc application type like {@link #APPTYPE_CSIM}. * All uicc applications are uniquely identified by application ID. See ETSI 102.221 and 101.220 diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index cf13b431daac..15a8dae061ec 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1615,4 +1615,9 @@ interface ITelephony { * return true if TTY over VoLTE is enabled for the subscription specified. */ boolean isTtyOverVolteEnabled(int subId); + + /** + * Return a list of certs in hex string from loaded carrier privileges access rules. + */ + List getCertsFromCarrierPrivilegeAccessRules(int subId); } -- cgit v1.2.3-59-g8ed1b