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

Commit af8022d9 authored by Grace Jia's avatar Grace Jia
Browse files

Check calling package before send stored text.

Prevent third-party app checking if a provider installed by trying to
send text message.

Bug: 193434069
Test: Unit test, manually test with debug app
Change-Id: I5c4019d44f40484e69b543eadb1858e7c3c84bf9
parent 039dec8c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -515,6 +515,10 @@ public class SmsController extends ISmsImplBase {
            Uri messageUri, String scAddress, PendingIntent sentIntent,
            PendingIntent deliveryIntent) {
        IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId);
        if (!getCallingPackage().equals(callingPkg)) {
            throw new SecurityException("sendStoredText: Package " + callingPkg
                    + "does not belong to " + Binder.getCallingUid());
        }
        if (iccSmsIntMgr != null) {
            iccSmsIntMgr.sendStoredText(callingPkg, callingAttributionTag, messageUri, scAddress,
                    sentIntent, deliveryIntent);