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

Commit ddc1d1d9 authored by Lucas Katt's avatar Lucas Katt
Browse files

Updating ISms interface and SmsManager to allow retrieving WAP push message size

As part of the effort to support MMS over satellite, we want to limit
the size of MMS that can be downloaded while using a satellite
connection. This cl adds a new method signature for getWapMessageSize to
ISms interfaces and SmsManager so that in
frameworks/opt/telephony we can add the implementation of
getWapMessageSize to SmsController. In the future, the message size will
be retrieved during MMS download and if it exceeds some threshold the
download will be prevented.

Test: tests added in other topic cl

Bug: 311244479

Change-Id: I6adc85d504f88dcabddc7c982e7c494498311d37
parent 46def932
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();
    }

}