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

Skip to content
Commit e510fa4c authored by David Brown's avatar David Brown
Browse files

Fix permissions check in IccSmsInterfaceManager.sendText()

In android.internal.telephony.IccSmsInterfaceManager, we currently use
enforceCallingPermission() rather than enforceCallingOrSelfPermission()
to enforce the SEND_SMS permission.

The difference is that enforceCallingPermission() will ALWAYS throw a
SecurityException if you're not handling an IPC, i.e. if the request is
from the same process as the telephony framework.

In other words, the current code prevents the phone app from ever using
SmsManager.sendTextMessage() :-(

This change fixes IccSmsInterfaceManager.sendText() to use
enforceCallingOrSelfPermission(), and I confirmed I can now send SMSes
from the phone app.

NOTE there are a bunch of other uses of enforceCallingPermission() in the
telephony framework (all SMS-related) that we probably want to fix too,
although I'm fixing just this one for now since it's blocking a hi-pri
phone UI feature.  I opened bug 4686733 to cover the rest of the cleanup,
though.

Bug: 4686733
Change-Id: Iaffcf62c54493fa4961fb20894c974697f26e3a7
parent 25b93ade
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment