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

Skip to content
Commit bf19af2c authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Ensure SystemApps get SMS AppOp permissions

Certain System Apps, like Phone and TelephonyProvider, should be granted
SMS-related AppOp permissions automatically. This currently happens
whenever we query who the default sms app is, as part of that flow.
However, it needs to happen even if there is no default sms app.
Currently, this will generally eventually randomly happen (due to the
nature of the codepath), but it isn't consistent and can take a long
time. It should always happen immediately on first boot.

In particular, this ensures that the TelephonyProvider package gets the
permission (including AppOp) for WRITE_SMS, enabling it to write to the
telephony raw database of user 0, regardless of whether user 0 has a
default SMS app. This is particularly important in the case of HSUM
(Headless System User Mode), in which user 0 will generally not have a
messanger app, but still needs to handle the raw database.

Flag: com.android.internal.telephony.flags.sms_mms_deliver_broadcasts_redirect_to_main_user
Test: flash-wipe an HSUM device and ensure that incoming messages are
      written to user 0's raw database:
      adb shell sha1sum data/user_de/0/com.android.providers.telephony/databases/mmssms.db
Bug: 355209017
Change-Id: Ic3113b471de9d7b3fde5557e57cd515377e23ce9
parent 28f6a526
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment