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

Commit 7c04808c authored by Lucas Katt's avatar Lucas Katt Committed by Android (Google) Code Review
Browse files

Merge "Updating ISms interface and SmsManager to allow retrieving WAP push message size" into main

parents 8b928d6f ddc1d1d9
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -3556,4 +3556,29 @@ public final class SmsManager {
        }
        return smscUri;
    }

    /**
     * Gets the message size of a WAP from the cache.
     *
     * @param locationUrl the location to use as a key for looking up the size in the cache.
     * The locationUrl may or may not have the transactionId appended to the url.
     *
     * @return long representing the message size
     * @throws java.util.NoSuchElementException if the WAP push doesn't exist in the cache
     * @throws IllegalArgumentException if the locationUrl is empty
     *
     * @hide
     */
    public long getWapMessageSize(@NonNull String locationUrl) {
        try {
            ISms iSms = getISmsService();
            if (iSms != null) {
                return iSms.getWapMessageSize(locationUrl);
            } else {
                throw new RuntimeException("Could not acquire ISms service.");
            }
        } catch (RemoteException ex) {
            throw new RuntimeException(ex);
        }
    }
}
+13 −0
Original line number Diff line number Diff line
@@ -592,4 +592,17 @@ interface ISms {
     * @hide
     */
    boolean resetAllCellBroadcastRanges(int subId);

    /**
     * Gets the message size of a WAP from the cache.
     *
     * @param locationUrl the location to use as a key for looking up the size in the cache.
     * The locationUrl may or may not have the transactionId appended to the url.
     *
     * @return long representing the message size
     * @throws java.util.NoSuchElementException if the WAP push doesn't exist in the cache
     *
     * @hide
     */
    long getWapMessageSize(String locationUrl);
}
+6 −0
Original line number Diff line number Diff line
@@ -227,4 +227,10 @@ public class ISmsImplBase extends ISms.Stub {
    public boolean resetAllCellBroadcastRanges(int subId) {
        throw new UnsupportedOperationException();
    }

    @Override
    public long getWapMessageSize(String locationUrl) {
        throw new UnsupportedOperationException();
    }

}