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 Test: manually verified that the following still worked on both non-HSUM and, where applicable, HSUM phones: receiving/sending sms, sending/receiving phone calls, internet data Bug: 355209017 Change-Id: If89a6cd4767412a87481afab69b026b829a225dd
Loading
Please register or sign in to comment