diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index c4a501d336bce..2a6099a18fabb 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -13296,6 +13296,29 @@ public class TelephonyManager { } } + /** + * Test API to verify carrier restriction status allow list i.e. + * packages/services/Telephony/assets/CarrierRestrictionOperatorDetails.json. + * + * @param pkgName : packaga name of the entry to verify + * @param carrierId : carrier Id of the entry + * @return {@code List} : list of registered shaIds + * @hide + */ + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + public List getShaIdFromAllowList(String pkgName, int carrierId) { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getShaIdFromAllowList(pkgName, carrierId); + } + } catch (RemoteException ex) { + Rlog.e(TAG, "getShaIdFromAllowList: RemoteException = " + ex); + throw ex.rethrowAsRuntimeException(); + } + return Collections.EMPTY_LIST; + } + /** * Used to enable or disable carrier data by the system based on carrier signalling or * carrier privileged apps. Different from {@link #setDataEnabled(boolean)} which is linked to diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 21aad73ce0057..23f4217caf9d0 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -3037,4 +3037,11 @@ interface ITelephony { * @return {@code true} if the timeout duration is set successfully, {@code false} otherwise. */ boolean setSatelliteDeviceAlignedTimeoutDuration(long timeoutMillis); + + /** + * Test method to confirm the file contents are not altered. + */ + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(" + + "android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)") + List getShaIdFromAllowList(String pkgName, int carrierId); }