summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Taesu Lee <taesu82.lee@samsung.com> 2020-04-24 15:11:08 +0900
committer Amit Mahajan <amitmahajan@google.com> 2020-10-06 18:13:58 +0000
commita248f3586f844821a6c18243d0308c507e047128 (patch)
tree8584bafed986138b982475009a7e6bc236236640
parent93a807bcf78a7b0ea1126e7e9fc30b340b67593a (diff)
Expose getSmsCapacityOnIcc()
Unhide getSmsCapacityOnIcc() and it requires READ_PHONE_STATE instead. Bug: 154878196 Test: Manual Signed-off-by: Taesu Lee <taesu82.lee@samsung.com> Merged-in: I86ba39d5073227ff55251fabc614fd3b9347285e Change-Id: I86ba39d5073227ff55251fabc614fd3b9347285e
-rw-r--r--api/current.txt1
-rwxr-xr-xapi/system-current.txt1
-rw-r--r--non-updatable-api/current.txt1
-rw-r--r--non-updatable-api/system-current.txt1
-rw-r--r--telephony/java/android/telephony/SmsManager.java26
5 files changed, 19 insertions, 11 deletions
diff --git a/api/current.txt b/api/current.txt
index 87b0cc85366a..31c5c55e9fa8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -47902,6 +47902,7 @@ package android.telephony {
method @NonNull public android.os.Bundle getCarrierConfigValues();
method public static android.telephony.SmsManager getDefault();
method public static int getDefaultSmsSubscriptionId();
+ method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getSmsCapacityOnIcc();
method 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/api/system-current.txt b/api/system-current.txt
index c0364a3de18f..ae60b22997b2 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -11050,7 +11050,6 @@ package android.telephony {
method public boolean disableCellBroadcastRange(int, int, int);
method public boolean enableCellBroadcastRange(int, int, int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getPremiumSmsConsent(@NonNull String);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSmsCapacityOnIcc();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPremiumSmsConsent(@NonNull String, int);
field public static final int PREMIUM_SMS_CONSENT_ALWAYS_ALLOW = 3; // 0x3
diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt
index b1373de5ea6c..1736173e06e2 100644
--- a/non-updatable-api/current.txt
+++ b/non-updatable-api/current.txt
@@ -46070,6 +46070,7 @@ package android.telephony {
method @NonNull public android.os.Bundle getCarrierConfigValues();
method public static android.telephony.SmsManager getDefault();
method public static int getDefaultSmsSubscriptionId();
+ method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getSmsCapacityOnIcc();
method 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/non-updatable-api/system-current.txt b/non-updatable-api/system-current.txt
index 31b71fb5ca4d..5c0a044462e5 100644
--- a/non-updatable-api/system-current.txt
+++ b/non-updatable-api/system-current.txt
@@ -9932,7 +9932,6 @@ package android.telephony {
method public boolean disableCellBroadcastRange(int, int, int);
method public boolean enableCellBroadcastRange(int, int, int);
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getPremiumSmsConsent(@NonNull String);
- method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSmsCapacityOnIcc();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPremiumSmsConsent(@NonNull String, int);
field public static final int PREMIUM_SMS_CONSENT_ALWAYS_ALLOW = 3; // 0x3
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index d6ce40c24b78..af49dc4bb9b3 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -2091,17 +2091,25 @@ public final class SmsManager {
}
/**
- * Gets the total capacity of SMS storage on RUIM and SIM cards
- * <p>
- * This is the number of 176 byte EF-SMS records which can be stored on the RUIM or SIM card.
+ * Gets the total capacity of SMS storage on the SIM card.
+ *
* <p>
- * See 3GPP TS 31.102 - 4.2.25 - EF-SMS for more information
+ * This is the number of 176 byte EF-SMS records which can be stored on the SIM card.
+ * See 3GPP TS 31.102 - 4.2.25 - EF-SMS for more information.
+ * </p>
*
- * @return the total number of SMS records which can be stored on the RUIM or SIM cards.
- * @hide
+ * <p class="note"><strong>Note:</strong> This method will never trigger an SMS disambiguation
+ * dialog. If this method is called on a device that has multiple active subscriptions, this
+ * {@link SmsManager} instance has been created with {@link #getDefault()}, and no user-defined
+ * default subscription is defined, the subscription ID associated with this method will be
+ * INVALID, which will result in the operation being completed on the subscription associated
+ * with logical slot 0. Use {@link #getSmsManagerForSubscriptionId(int)} to ensure the operation
+ * is performed on the correct subscription.
+ * </p>
+ *
+ * @return the total number of SMS records which can be stored on the SIM card.
*/
- @SystemApi
- @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public int getSmsCapacityOnIcc() {
int ret = 0;
try {
@@ -2110,7 +2118,7 @@ public final class SmsManager {
ret = iccISms.getSmsCapacityOnIccForSubscriber(getSubscriptionId());
}
} catch (RemoteException ex) {
- //ignore it
+ throw new RuntimeException(ex);
}
return ret;
}