Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10179059 authored by Tyler Gunn's avatar Tyler Gunn Committed by Gerrit Code Review
Browse files

Merge "Telephony: Get SIM card capacity count of SMS"

parents 7339d174 db15271a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8808,6 +8808,7 @@ package android.telephony {
  public final class SmsManager {
    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 getSmsCapacityOnIcc();
    method public void sendMultipartTextMessage(@NonNull String, @NonNull String, @NonNull java.util.List<java.lang.String>, @Nullable java.util.List<android.app.PendingIntent>, @Nullable java.util.List<android.app.PendingIntent>, @NonNull String);
    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>);
  }
+21 −0
Original line number Diff line number Diff line
@@ -2000,6 +2000,27 @@ public final class SmsManager {
        }
    }

    /**
     * Gets the total capacity of SMS storage on RUIM and SIM cards
     *
     * @return the total capacity count of SMS on RUIM and SIM cards
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    public int getSmsCapacityOnIcc() {
        int ret = 0;
        try {
            ISms iccISms = getISmsService();
            if (iccISms != null) {
                ret = iccISms.getSmsCapacityOnIccForSubscriber(getSubscriptionId());
            }
        } catch (RemoteException ex) {
            //ignore it
        }
        return ret;
    }

    // see SmsMessage.getStatusOnIcc

    /** Free space (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27). */
+8 −0
Original line number Diff line number Diff line
@@ -593,4 +593,12 @@ interface ISms {
     * @return true for success, false otherwise.
     */
    boolean setSmscAddressOnIccEfForSubscriber(String smsc, int subId, String callingPackage);

    /**
     * Get the capacity count of sms on Icc card.
     *
     * @param subId for subId which getSmsCapacityOnIcc is queried.
     * @return capacity of ICC
     */
    int getSmsCapacityOnIccForSubscriber(int subId);
}
+5 −0
Original line number Diff line number Diff line
@@ -212,4 +212,9 @@ public class ISmsImplBase extends ISms.Stub {
            String smsc, int subId, String callingPackage) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int getSmsCapacityOnIccForSubscriber(int subId) {
        throw new UnsupportedOperationException();
    }
}