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

Commit 49f3756b authored by Ta-wei Yen's avatar Ta-wei Yen
Browse files

Throw SecurityException in sendVisualVoicemailSms()

Previously if the caller is not the active VVM service, the exception
will be consumed by the Binder because it is a oneway method.

This CL changes the method to non-oneway so the caller will receive
the exception. Docs are also updated.

Change-Id: Iedf96539be3958a92e151b926ee069d6edfc4d09
Fixes: 35854031
Test: CTS - VisualVoicemailServiceTest
parent 296417a9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ import android.util.Log;
 * the SMS filtering chain and may intercept the visual voicemail SMS before it reaches this
 * service.
 * <p>
 * To extend this class, The service must be declared in the manifest file with
 * the {@link android.Manifest.permission#BIND_VISUAL_VOICEMAIL_SERVICE} permission and include an
 * intent filter with the {@link #SERVICE_INTERFACE} action.
 * <p>
 * Below is an example manifest registration for a {@code VisualVoicemailService}.
 * <pre>
 * {@code
@@ -260,6 +264,9 @@ public abstract class VisualVoicemailService extends Service {
     * @param port The destination port for data SMS, or 0 for text SMS.
     * @param text The message content. For data sms, it will be encoded as a UTF-8 byte stream.
     * @param sentIntent The sent intent passed to the {@link SmsManager}
     *
     * @throws SecurityException if the caller is not the current default dialer
     *
     * @see SmsManager#sendDataMessage(String, String, short, byte[], PendingIntent, PendingIntent)
     * @see SmsManager#sendTextMessage(String, String, String, PendingIntent, PendingIntent)
     */
+1 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ interface ITelephony {
     * Send a visual voicemail SMS. Internal use only.
     * Requires caller to be the default dialer and have SEND_SMS permission
     */
    oneway void sendVisualVoicemailSmsForSubscriber(in String callingPackage, in int subId,
    void sendVisualVoicemailSmsForSubscriber(in String callingPackage, in int subId,
            in String number, in int port, in String text, in PendingIntent sentIntent);

    // Send the special dialer code. The IPC caller must be the current default dialer.