Merge "Expose getSmsCapacityOnIcc()"

This commit is contained in:
Treehugger Robot
2020-10-06 20:12:05 +00:00
committed by Gerrit Code Review
5 changed files with 20 additions and 12 deletions

View File

@@ -47910,6 +47910,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();

View File

@@ -11075,7 +11075,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

View File

@@ -46078,6 +46078,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();

View File

@@ -9957,7 +9957,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

View File

@@ -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.
* <p>
* See 3GPP TS 31.102 - 4.2.25 - EF-SMS for more information
* Gets the total capacity of SMS storage on the SIM card.
*
* @return the total number of SMS records which can be stored on the RUIM or SIM cards.
* @hide
* <p>
* 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>
*
* <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;
}