diff --git a/core/api/current.txt b/core/api/current.txt index 9dd3a4be049a3..5fcafc7104bc0 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -41806,7 +41806,7 @@ package android.telephony { method @NonNull public android.os.Bundle getCarrierConfigValues(); method @Deprecated public static android.telephony.SmsManager getDefault(); method public static int getDefaultSmsSubscriptionId(); - method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getSmsCapacityOnIcc(); + method @IntRange(from=0) @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public int getSmsCapacityOnIcc(); method @Deprecated public static android.telephony.SmsManager getSmsManagerForSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.SMS_FINANCIAL_TRANSACTIONS) public void getSmsMessagesForFinancialApp(android.os.Bundle, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.SmsManager.FinancialSmsCallback); method @Nullable @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getSmscAddress(); diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java index 4926687f67240..17af4638c8746 100644 --- a/telephony/java/android/telephony/SmsManager.java +++ b/telephony/java/android/telephony/SmsManager.java @@ -19,6 +19,7 @@ package android.telephony; import android.Manifest; import android.annotation.CallbackExecutor; import android.annotation.IntDef; +import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; @@ -2207,7 +2208,9 @@ public final class SmsManager { * * @return the total number of SMS records which can be stored on the SIM card. */ - @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + @RequiresPermission(anyOf = {android.Manifest.permission.READ_PHONE_STATE, + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE}) + @IntRange(from = 0) public int getSmsCapacityOnIcc() { int ret = 0; try {