Whitelist telephony broadcasts for bground use

Whitelisted telephony broadcasts using the intent background flag.
Ensured that each broadcast was protected manually through cts test below.

Bug: 148181747
Test: Switched on ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK for SIM_STATE_CHANGED
Test:  android.telephony.cts.TelephonyProtectedBroadcastsTest
Change-Id: Id280fc2128b84dda2a8184dfa32ecc5b8f787afb
This commit is contained in:
Daniel Bright
2020-01-29 15:10:04 -08:00
parent 6923cdd83d
commit 8acac15ced
2 changed files with 21 additions and 4 deletions

View File

@@ -71,7 +71,6 @@ public class CellBroadcastIntents {
int initialCode, int slotIndex) {
Intent backgroundIntent = new Intent(Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION);
backgroundIntent.putExtra(EXTRA_MESSAGE, smsCbMessage);
backgroundIntent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
putPhoneIdAndSubIdExtra(context, backgroundIntent, slotIndex);
String receiverPermission = Manifest.permission.RECEIVE_SMS;

View File

@@ -19,11 +19,29 @@
<!-- Broadcast actions that are currently exempted from O+ background
delivery restrictions. -->
<allow-implicit-broadcast action="android.intent.action.SIM_STATE_CHANGED" />
<allow-implicit-broadcast action="android.intent.action.PACKAGE_CHANGED" />
<allow-implicit-broadcast action="android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED" />
<allow-implicit-broadcast action="android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED" />
<allow-implicit-broadcast action="android.intent.action.DATA_SMS_RECEIVED" />
<allow-implicit-broadcast action="android.intent.action.MEDIA_SCANNER_SCAN_FILE" />
<allow-implicit-broadcast action="android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION" />
<allow-implicit-broadcast action="android.intent.action.PACKAGE_CHANGED" />
<allow-implicit-broadcast action="android.intent.action.SIM_STATE_CHANGED" />
<allow-implicit-broadcast action="android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION" />
<allow-implicit-broadcast action="android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION" />
<allow-implicit-broadcast action="android.provider.Telephony.SECRET_CODE" />
<allow-implicit-broadcast action="android.provider.Telephony.SMS_CB_RECEIVED" />
<allow-implicit-broadcast action="android.provider.Telephony.SMS_DELIVER" />
<allow-implicit-broadcast action="android.provider.Telephony.SMS_RECEIVED" />
<allow-implicit-broadcast action="android.provider.Telephony.SMS_REJECTED" />
<allow-implicit-broadcast action="android.provider.Telephony.WAP_PUSH_DELIVER" />
<allow-implicit-broadcast action="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<allow-implicit-broadcast action="android.telephony.action.CARRIER_CONFIG_CHANGED" />
<allow-implicit-broadcast action="android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
<allow-implicit-broadcast action="android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED" />
<allow-implicit-broadcast action="android.telephony.action.SECRET_CODE" />
<allow-implicit-broadcast action="android.telephony.action.SIM_APPLICATION_STATE_CHANGED" />
<allow-implicit-broadcast action="android.telephony.action.SIM_CARD_STATE_CHANGED" />
<allow-implicit-broadcast action="android.telephony.action.SIM_SLOT_STATUS_CHANGED" />
<!-- Whitelist of what components are permitted as backup data transports. The
'service' attribute here is a flattened ComponentName string. -->