Permission Denial: not allowed to send broadcast in android

因为最近项目里Intent用到了广播”android.intent.action.MEDIA_MOUNTED”, 结果被提示权限不足, 查了下原因, 是因为从4.4开始, 官方开始限制这个广播的使用, 加上了 protected权限, 只能系统内部使用. 如下:

   <protected-broadcast android:name="android.intent.action.MEDIA_MOUNTED" />

想想也在情理之中, 否则就是因为需要加载一张图片, 就需要重新挂载, 电量什么的岂不是嗖嗖的掉.

解决办法就是使用如下方法代替:

MediaScannerConnectionACTION_MEDIA_SCANNER_SCAN_FILE

MediaScannerConnection.scanFile(getApplicationContext(), new String[] { file.getAbsolutePath() }, null, new OnScanCompletedListener() {                    @Override                  public void onScanCompleted(String path, Uri uri) {                      // TODO Auto-generated method stub                    }              }); 

然后从谷歌找到了如下manifest, 方便需要的时候查找.

转自: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="android" coreApp="true" android:sharedUserId="android.uid.system"      android:sharedUserLabel="@string/android_system_label">      <!-- ================================================ -->      <!-- Special broadcasts that only the system can send -->      <!-- ================================================ -->      <eat-comment />      <protected-broadcast android:name="android.intent.action.SCREEN_OFF" />      <protected-broadcast android:name="android.intent.action.SCREEN_ON" />      <protected-broadcast android:name="android.intent.action.USER_PRESENT" />      <protected-broadcast android:name="android.intent.action.TIME_SET" />      <protected-broadcast android:name="android.intent.action.TIME_TICK" />      <protected-broadcast android:name="android.intent.action.TIMEZONE_CHANGED" />      <protected-broadcast android:name="android.intent.action.DATE_CHANGED" />      <protected-broadcast android:name="android.intent.action.PRE_BOOT_COMPLETED" />      <protected-broadcast android:name="android.intent.action.BOOT_COMPLETED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_INSTALL" />      <protected-broadcast android:name="android.intent.action.PACKAGE_ADDED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_REPLACED" />      <protected-broadcast android:name="android.intent.action.MY_PACKAGE_REPLACED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_REMOVED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_CHANGED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_ENABLE_ROLLBACK" />      <protected-broadcast android:name="android.intent.action.CANCEL_ENABLE_ROLLBACK" />      <protected-broadcast android:name="android.intent.action.ROLLBACK_COMMITTED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_RESTARTED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_DATA_CLEARED" />      <protected-broadcast android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />      <protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />      <protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />      <protected-broadcast android:name="android.intent.action.PACKAGES_SUSPENDED" />      <protected-broadcast android:name="android.intent.action.PACKAGES_UNSUSPENDED" />      <protected-broadcast android:name="android.intent.action.DISTRACTING_PACKAGES_CHANGED" />      <protected-broadcast android:name="android.intent.action.ACTION_PREFERRED_ACTIVITY_CHANGED" />      <protected-broadcast android:name="android.intent.action.UID_REMOVED" />      <protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />      <protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />      <protected-broadcast android:name="android.intent.action.SPLIT_CONFIGURATION_CHANGED" />      <protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />      <protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />      <protected-broadcast android:name="android.intent.action.BATTERY_LEVEL_CHANGED" />      <protected-broadcast android:name="android.intent.action.BATTERY_LOW" />      <protected-broadcast android:name="android.intent.action.BATTERY_OKAY" />      <protected-broadcast android:name="android.intent.action.ACTION_POWER_CONNECTED" />      <protected-broadcast android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />      <protected-broadcast android:name="android.intent.action.ACTION_SHUTDOWN" />      <protected-broadcast android:name="android.intent.action.CHARGING" />      <protected-broadcast android:name="android.intent.action.DISCHARGING" />      <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_LOW" />      <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_OK" />      <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_FULL" />      <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_NOT_FULL" />      <protected-broadcast android:name="android.intent.action.NEW_OUTGOING_CALL" />      <protected-broadcast android:name="android.intent.action.REBOOT" />      <protected-broadcast android:name="android.intent.action.DOCK_EVENT" />      <protected-broadcast android:name="android.intent.action.THERMAL_EVENT" />      <protected-broadcast android:name="android.intent.action.MASTER_CLEAR_NOTIFICATION" />      <protected-broadcast android:name="android.intent.action.USER_ADDED" />      <protected-broadcast android:name="android.intent.action.USER_REMOVED" />      <protected-broadcast android:name="android.intent.action.USER_STARTING" />      <protected-broadcast android:name="android.intent.action.USER_STARTED" />      <protected-broadcast android:name="android.intent.action.USER_STOPPING" />      <protected-broadcast android:name="android.intent.action.USER_STOPPED" />      <protected-broadcast android:name="android.intent.action.USER_BACKGROUND" />      <protected-broadcast android:name="android.intent.action.USER_FOREGROUND" />      <protected-broadcast android:name="android.intent.action.USER_SWITCHED" />      <protected-broadcast android:name="android.intent.action.USER_INITIALIZE" />      <protected-broadcast android:name="android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION" />      <protected-broadcast android:name="android.intent.action.OVERLAY_ADDED" />      <protected-broadcast android:name="android.intent.action.OVERLAY_CHANGED" />      <protected-broadcast android:name="android.intent.action.OVERLAY_REMOVED" />      <protected-broadcast android:name="android.intent.action.OVERLAY_PRIORITY_CHANGED" />      <protected-broadcast android:name="android.intent.action.USER_ACTIVITY_NOTIFICATION" />      <protected-broadcast android:name="android.intent.action.MY_PACKAGE_SUSPENDED" />      <protected-broadcast android:name="android.intent.action.MY_PACKAGE_UNSUSPENDED" />      <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED" />      <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGING" />      <protected-broadcast android:name="android.os.action.DEVICE_IDLE_MODE_CHANGED" />      <protected-broadcast android:name="android.os.action.POWER_SAVE_WHITELIST_CHANGED" />      <protected-broadcast android:name="android.os.action.POWER_SAVE_TEMP_WHITELIST_CHANGED" />      <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED_INTERNAL" />      <!-- @deprecated This is rarely used and will be phased out soon. -->      <protected-broadcast android:name="android.os.action.SCREEN_BRIGHTNESS_BOOST_CHANGED" />      <protected-broadcast android:name="android.app.action.ENTER_CAR_MODE" />      <protected-broadcast android:name="android.app.action.EXIT_CAR_MODE" />      <protected-broadcast android:name="android.app.action.ENTER_DESK_MODE" />      <protected-broadcast android:name="android.app.action.EXIT_DESK_MODE" />      <protected-broadcast android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />      <protected-broadcast android:name="android.app.action.BUGREPORT_SHARING_DECLINED" />      <protected-broadcast android:name="android.app.action.BUGREPORT_FAILED" />      <protected-broadcast android:name="android.app.action.BUGREPORT_SHARE" />      <protected-broadcast android:name="android.app.action.SHOW_DEVICE_MONITORING_DIALOG" />      <protected-broadcast android:name="android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED" />      <protected-broadcast android:name="android.intent.action.INCIDENT_REPORT_READY" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_UPDATE_OPTIONS" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DELETED" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_DISABLED" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_ENABLED" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED" />      <protected-broadcast android:name="android.appwidget.action.APPWIDGET_RESTORED" />      <protected-broadcast android:name="android.os.action.SETTING_RESTORED" />      <protected-broadcast android:name="android.app.backup.intent.RUN" />      <protected-broadcast android:name="android.app.backup.intent.CLEAR" />      <protected-broadcast android:name="android.app.backup.intent.INIT" />      <protected-broadcast android:name="android.bluetooth.intent.DISCOVERABLE_TIMEOUT" />      <protected-broadcast android:name="android.bluetooth.adapter.action.STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.SCAN_MODE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.DISCOVERY_STARTED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.DISCOVERY_FINISHED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.LOCAL_NAME_CHANGED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.BLUETOOTH_ADDRESS_CHANGED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.device.action.UUID" />      <protected-broadcast android:name="android.bluetooth.device.action.MAS_INSTANCE" />      <protected-broadcast android:name="android.bluetooth.device.action.ALIAS_CHANGED" />      <protected-broadcast android:name="android.bluetooth.device.action.FOUND" />      <protected-broadcast android:name="android.bluetooth.device.action.CLASS_CHANGED" />      <protected-broadcast android:name="android.bluetooth.device.action.ACL_CONNECTED" />      <protected-broadcast android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED" />      <protected-broadcast android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />      <protected-broadcast android:name="android.bluetooth.device.action.NAME_CHANGED" />      <protected-broadcast android:name="android.bluetooth.device.action.BOND_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.device.action.NAME_FAILED" />      <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_REQUEST" />      <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_CANCEL" />      <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REPLY" />      <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL" />      <protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST" />      <protected-broadcast android:name="android.bluetooth.device.action.SDP_RECORD" />      <protected-broadcast android:name="android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" />      <protected-broadcast android:name="android.bluetooth.devicepicker.action.LAUNCH" />      <protected-broadcast android:name="android.bluetooth.devicepicker.action.DEVICE_SELECTED" />      <protected-broadcast          android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT" />      <protected-broadcast          android:name="android.bluetooth.headset.action.HF_INDICATORS_VALUE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.AUDIO_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.AG_EVENT" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.AG_CALL_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.RESULT" />      <protected-broadcast          android:name="android.bluetooth.headsetclient.profile.action.LAST_VTAG" />      <protected-broadcast          android:name="android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.hearingaid.profile.action.PLAYING_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp-sink.profile.action.PLAYING_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.a2dp-sink.profile.action.AUDIO_CONFIG_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.avrcp-controller.profile.action.BROWSE_CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.avrcp-controller.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.avrcp-controller.profile.action.FOLDER_LIST" />      <protected-broadcast          android:name="android.bluetooth.avrcp-controller.profile.action.TRACK_EVENT" />      <protected-broadcast          android:name="android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.input.profile.action.IDLE_TIME_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.input.profile.action.PROTOCOL_MODE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.input.profile.action.VIRTUAL_UNPLUG_STATUS" />      <protected-broadcast          android:name="android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast          android:name="android.bluetooth.map.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_RECEIVED" />      <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_SENT_SUCCESSFULLY" />      <protected-broadcast android:name="android.bluetooth.mapmce.profile.action.MESSAGE_DELIVERED_SUCCESSFULLY" />      <protected-broadcast          android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_SENT" />      <protected-broadcast          android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />      <protected-broadcast          android:name="android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.btopp.intent.action.INCOMING_FILE_NOTIFICATION" />      <protected-broadcast android:name="android.btopp.intent.action.USER_CONFIRMATION_TIMEOUT" />      <protected-broadcast android:name="android.btopp.intent.action.LIST" />      <protected-broadcast android:name="android.btopp.intent.action.OPEN_OUTBOUND" />      <protected-broadcast android:name="android.btopp.intent.action.HIDE_COMPLETE" />      <protected-broadcast android:name="android.btopp.intent.action.CONFIRM" />      <protected-broadcast android:name="android.btopp.intent.action.HIDE" />      <protected-broadcast android:name="android.btopp.intent.action.RETRY" />      <protected-broadcast android:name="android.btopp.intent.action.OPEN" />      <protected-broadcast android:name="android.btopp.intent.action.OPEN_INBOUND" />      <protected-broadcast android:name="android.btopp.intent.action.TRANSFER_COMPLETE" />      <protected-broadcast android:name="android.btopp.intent.action.ACCEPT" />      <protected-broadcast android:name="android.btopp.intent.action.DECLINE" />      <protected-broadcast android:name="com.android.bluetooth.gatt.REFRESH_BATCHED_SCAN" />      <protected-broadcast android:name="com.android.bluetooth.pbap.authchall" />      <protected-broadcast android:name="com.android.bluetooth.pbap.userconfirmtimeout" />      <protected-broadcast android:name="com.android.bluetooth.pbap.authresponse" />      <protected-broadcast android:name="com.android.bluetooth.pbap.authcancelled" />      <protected-broadcast android:name="com.android.bluetooth.sap.USER_CONFIRM_TIMEOUT" />      <protected-broadcast android:name="com.android.bluetooth.sap.action.DISCONNECT_ACTION" />      <protected-broadcast android:name="android.hardware.display.action.WIFI_DISPLAY_STATUS_CHANGED" />      <protected-broadcast android:name="android.hardware.usb.action.USB_STATE" />      <protected-broadcast android:name="android.hardware.usb.action.USB_PORT_CHANGED" />      <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />      <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_DETACHED" />      <protected-broadcast android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />      <protected-broadcast android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />      <protected-broadcast android:name="android.intent.action.HEADSET_PLUG" />      <protected-broadcast android:name="android.media.action.HDMI_AUDIO_PLUG" />      <protected-broadcast android:name="android.media.action.MICROPHONE_MUTE_CHANGED" />      <protected-broadcast android:name="android.media.action.SPEAKERPHONE_STATE_CHANGED" />      <protected-broadcast android:name="android.media.AUDIO_BECOMING_NOISY" />      <protected-broadcast android:name="android.media.RINGER_MODE_CHANGED" />      <protected-broadcast android:name="android.media.VIBRATE_SETTING_CHANGED" />      <protected-broadcast android:name="android.media.VOLUME_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.MASTER_VOLUME_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.MASTER_MUTE_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.MASTER_MONO_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.MASTER_BALANCE_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.SCO_AUDIO_STATE_CHANGED" />      <protected-broadcast android:name="android.media.ACTION_SCO_AUDIO_STATE_UPDATED" />      <protected-broadcast android:name="android.intent.action.MEDIA_REMOVED" />      <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTED" />      <protected-broadcast android:name="android.intent.action.MEDIA_CHECKING" />      <protected-broadcast android:name="android.intent.action.MEDIA_NOFS" />      <protected-broadcast android:name="android.intent.action.MEDIA_MOUNTED" />      <protected-broadcast android:name="android.intent.action.MEDIA_SHARED" />      <protected-broadcast android:name="android.intent.action.MEDIA_UNSHARED" />      <protected-broadcast android:name="android.intent.action.MEDIA_BAD_REMOVAL" />      <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTABLE" />      <protected-broadcast android:name="android.intent.action.MEDIA_EJECT" />      <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL" />      <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE" />      <!-- @deprecated.  Only {@link android.net.ConnectivityManager.CONNECTIVITY_ACTION} is sent. -->      <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE" />      <protected-broadcast android:name="android.net.conn.DATA_ACTIVITY_CHANGE" />      <protected-broadcast android:name="android.net.conn.RESTRICT_BACKGROUND_CHANGED" />      <protected-broadcast android:name="android.net.conn.BACKGROUND_DATA_SETTING_CHANGED" />      <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL_TEST_COMPLETED" />      <protected-broadcast android:name="android.net.nsd.STATE_CHANGED" />      <protected-broadcast android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />      <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" />      <protected-broadcast android:name="com.android.nfc.action.LLCP_UP" />      <protected-broadcast android:name="com.android.nfc.action.LLCP_DOWN" />      <protected-broadcast android:name="com.android.nfc.cardemulation.action.CLOSE_TAP_DIALOG" />      <protected-broadcast android:name="com.android.nfc.handover.action.ALLOW_CONNECT" />      <protected-broadcast android:name="com.android.nfc.handover.action.DENY_CONNECT" />      <protected-broadcast android:name="com.android.nfc.handover.action.TIMEOUT_CONNECT" />      <protected-broadcast android:name="com.android.nfc_extras.action.RF_FIELD_ON_DETECTED" />      <protected-broadcast android:name="com.android.nfc_extras.action.RF_FIELD_OFF_DETECTED" />      <protected-broadcast android:name="com.android.nfc_extras.action.AID_SELECTED" />      <!-- For NFC to BT handover -->      <protected-broadcast android:name="android.btopp.intent.action.WHITELIST_DEVICE" />      <protected-broadcast android:name="android.btopp.intent.action.STOP_HANDOVER_TRANSFER" />      <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_SEND" />      <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_SEND_MULTIPLE" />      <protected-broadcast android:name="com.android.nfc.handover.action.CANCEL_HANDOVER_TRANSFER" />      <protected-broadcast android:name="android.intent.action.CLEAR_DNS_CACHE" />      <protected-broadcast android:name="android.intent.action.PROXY_CHANGE" />      <protected-broadcast android:name="android.os.UpdateLock.UPDATE_LOCK_CHANGED" />      <protected-broadcast android:name="android.intent.action.DREAMING_STARTED" />      <protected-broadcast android:name="android.intent.action.DREAMING_STOPPED" />      <protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />      <protected-broadcast android:name="com.android.server.stats.action.TRIGGER_COLLECTION" />      <protected-broadcast android:name="com.android.server.WifiManager.action.START_SCAN" />      <protected-broadcast android:name="com.android.server.WifiManager.action.START_PNO" />      <protected-broadcast android:name="com.android.server.WifiManager.action.DELAYED_DRIVER_STOP" />      <protected-broadcast android:name="com.android.server.WifiManager.action.DEVICE_IDLE" />      <protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_ACCEPTED" />      <protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_DECLINED" />      <protected-broadcast android:name="com.android.internal.action.EUICC_FACTORY_RESET" />      <protected-broadcast android:name="com.android.server.usb.ACTION_OPEN_IN_APPS" />      <protected-broadcast android:name="com.android.server.am.DELETE_DUMPHEAP" />      <protected-broadcast android:name="com.android.server.net.action.SNOOZE_WARNING" />      <protected-broadcast android:name="com.android.server.net.action.SNOOZE_RAPID" />      <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.USER_DISMISSED_NOTIFICATION" />      <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.CONNECT_TO_NETWORK" />      <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_WIFI_NETWORK" />      <protected-broadcast android:name="com.android.server.wifi.ConnectToNetworkNotification.PICK_NETWORK_AFTER_FAILURE" />      <protected-broadcast android:name="com.android.server.wifi.wakeup.DISMISS_NOTIFICATION" />      <protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_PREFERENCES" />      <protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_SETTINGS" />      <protected-broadcast android:name="com.android.server.wifi.wakeup.TURN_OFF_WIFI_WAKE" />      <protected-broadcast android:name="android.net.wifi.WIFI_STATE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.WIFI_AP_STATE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.WIFI_CREDENTIAL_CHANGED" />      <protected-broadcast android:name="android.net.wifi.WIFI_SCAN_AVAILABLE" />      <protected-broadcast android:name="android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.SCAN_RESULTS" />      <protected-broadcast android:name="android.net.wifi.RSSI_CHANGED" />      <protected-broadcast android:name="android.net.wifi.STATE_CHANGE" />      <protected-broadcast android:name="android.net.wifi.LINK_CONFIGURATION_CHANGED" />      <protected-broadcast android:name="android.net.wifi.CONFIGURED_NETWORKS_CHANGE" />      <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_DEAUTH_IMMINENT" />      <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_ICON" />      <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST" />      <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION" />      <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW" />      <protected-broadcast android:name="android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION" />      <protected-broadcast android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />      <protected-broadcast android:name="android.net.wifi.supplicant.STATE_CHANGE" />      <protected-broadcast android:name="android.net.wifi.p2p.STATE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.p2p.DISCOVERY_STATE_CHANGE" />      <protected-broadcast android:name="android.net.wifi.p2p.THIS_DEVICE_CHANGED" />      <protected-broadcast android:name="android.net.wifi.p2p.PEERS_CHANGED" />      <protected-broadcast android:name="android.net.wifi.p2p.CONNECTION_STATE_CHANGE" />      <protected-broadcast android:name="android.net.wifi.p2p.PERSISTENT_GROUPS_CHANGED" />      <protected-broadcast android:name="android.net.conn.TETHER_STATE_CHANGED" />      <protected-broadcast android:name="android.net.conn.INET_CONDITION_ACTION" />      <protected-broadcast android:name="android.net.conn.NETWORK_CONDITIONS_MEASURED" />      <protected-broadcast              android:name="android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED" />      <protected-broadcast android:name="android.net.scoring.SCORE_NETWORKS" />      <protected-broadcast android:name="android.net.scoring.SCORER_CHANGED" />      <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE" />      <protected-broadcast android:name="android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE" />      <protected-broadcast android:name="android.intent.action.AIRPLANE_MODE" />      <protected-broadcast android:name="android.intent.action.ADVANCED_SETTINGS" />      <protected-broadcast android:name="android.intent.action.APPLICATION_RESTRICTIONS_CHANGED" />      <!-- Legacy -->      <protected-broadcast android:name="android.intent.action.ACTION_IDLE_MAINTENANCE_START" />      <protected-broadcast android:name="android.intent.action.ACTION_IDLE_MAINTENANCE_END" />      <protected-broadcast android:name="com.android.server.ACTION_TRIGGER_IDLE" />      <protected-broadcast android:name="android.intent.action.HDMI_PLUGGED" />      <protected-broadcast android:name="android.intent.action.PHONE_STATE" />      <protected-broadcast android:name="android.intent.action.SUB_DEFAULT_CHANGED" />      <protected-broadcast android:name="android.location.PROVIDERS_CHANGED" />      <protected-broadcast android:name="android.location.MODE_CHANGED" />      <protected-broadcast android:name="android.net.proxy.PAC_REFRESH" />      <protected-broadcast android:name="android.telecom.action.DEFAULT_DIALER_CHANGED" />      <protected-broadcast android:name="android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED" />      <protected-broadcast android:name="android.provider.action.SMS_MMS_DB_CREATED" />      <protected-broadcast android:name="android.provider.action.SMS_MMS_DB_LOST" />      <protected-broadcast android:name="android.intent.action.CONTENT_CHANGED" />      <protected-broadcast android:name="android.provider.Telephony.MMS_DOWNLOADED" />      <protected-broadcast          android:name="com.android.server.connectivityservice.CONNECTED_TO_PROVISIONING_NETWORK_ACTION" />      <!-- Defined in RestrictionsManager -->      <protected-broadcast          android:name="android.intent.action.PERMISSION_RESPONSE_RECEIVED" />      <!-- Defined in RestrictionsManager -->      <protected-broadcast android:name="android.intent.action.REQUEST_PERMISSION" />      <protected-broadcast android:name="android.nfc.handover.intent.action.HANDOVER_STARTED" />      <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />      <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_PROGRESS" />      <protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />      <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED" />      <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED" />      <protected-broadcast android:name="android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE" />      <protected-broadcast android:name="android.intent.action.ACTION_SUBINFO_RECORD_UPDATED" />      <protected-broadcast android:name="android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE" />      <protected-broadcast android:name="android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED" />      <protected-broadcast android:name="android.internal.policy.action.BURN_IN_PROTECTION" />      <protected-broadcast android:name="android.app.action.SYSTEM_UPDATE_POLICY_CHANGED" />      <protected-broadcast android:name="android.app.action.DEVICE_OWNER_CHANGED" />      <protected-broadcast android:name="android.app.action.MANAGED_USER_CREATED" />      <!-- Added in N -->      <protected-broadcast android:name="android.intent.action.ANR" />      <protected-broadcast android:name="android.intent.action.CALL" />      <protected-broadcast android:name="android.intent.action.CALL_PRIVILEGED" />      <protected-broadcast android:name="android.intent.action.DROPBOX_ENTRY_ADDED" />      <protected-broadcast android:name="android.intent.action.INPUT_METHOD_CHANGED" />      <protected-broadcast android:name="android.intent.action.internal_sim_state_changed" />      <protected-broadcast android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />      <protected-broadcast android:name="android.intent.action.PRECISE_CALL_STATE" />      <protected-broadcast android:name="android.intent.action.PRECISE_DATA_CONNECTION_STATE_CHANGED" />      <protected-broadcast android:name="android.intent.action.SUBSCRIPTION_PHONE_STATE" />      <protected-broadcast android:name="android.intent.action.USER_INFO_CHANGED" />      <protected-broadcast android:name="android.intent.action.USER_UNLOCKED" />      <protected-broadcast android:name="android.intent.action.WALLPAPER_CHANGED" />      <protected-broadcast android:name="android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED" />      <protected-broadcast android:name="android.app.action.CHOOSE_PRIVATE_KEY_ALIAS" />      <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_DISABLED" />      <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED" />      <protected-broadcast android:name="android.app.action.DEVICE_ADMIN_ENABLED" />      <protected-broadcast android:name="android.app.action.LOCK_TASK_ENTERING" />      <protected-broadcast android:name="android.app.action.LOCK_TASK_EXITING" />      <protected-broadcast android:name="android.app.action.NOTIFY_PENDING_SYSTEM_UPDATE" />      <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_CHANGED" />      <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_EXPIRING" />      <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_FAILED" />      <protected-broadcast android:name="android.app.action.ACTION_PASSWORD_SUCCEEDED" />      <protected-broadcast android:name="com.android.server.ACTION_EXPIRED_PASSWORD_NOTIFICATION" />      <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_ADDED" />      <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_UNLOCKED" />      <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_REMOVED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_STATE_CHANGED" />      <protected-broadcast android:name="com.android.bluetooth.map.USER_CONFIRM_TIMEOUT" />      <protected-broadcast android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_SENT" />      <protected-broadcast android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />      <protected-broadcast android:name="android.content.jobscheduler.JOB_DELAY_EXPIRED" />      <protected-broadcast android:name="android.content.syncmanager.SYNC_ALARM" />      <protected-broadcast android:name="android.media.INTERNAL_RINGER_MODE_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.STREAM_DEVICES_CHANGED_ACTION" />      <protected-broadcast android:name="android.media.STREAM_MUTE_CHANGED_ACTION" />      <protected-broadcast android:name="android.net.sip.SIP_SERVICE_UP" />      <protected-broadcast android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />      <protected-broadcast android:name="android.os.action.CHARGING" />      <protected-broadcast android:name="android.os.action.DISCHARGING" />      <protected-broadcast android:name="android.search.action.SEARCHABLES_CHANGED" />      <protected-broadcast android:name="android.security.STORAGE_CHANGED" />      <protected-broadcast android:name="android.security.action.TRUST_STORE_CHANGED" />      <protected-broadcast android:name="android.security.action.KEYCHAIN_CHANGED" />      <protected-broadcast android:name="android.security.action.KEY_ACCESS_CHANGED" />      <protected-broadcast android:name="android.telecom.action.NUISANCE_CALL_STATUS_CHANGED" />      <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_REGISTERED" />      <protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_UNREGISTERED" />      <protected-broadcast android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION" />      <protected-broadcast android:name="android.telephony.action.CARRIER_CONFIG_CHANGED" />      <protected-broadcast android:name="android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED" />      <protected-broadcast android:name="android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED" />      <protected-broadcast android:name="android.telephony.action.SECRET_CODE" />      <protected-broadcast android:name="android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION" />      <protected-broadcast android:name="android.telephony.action.SUBSCRIPTION_PLANS_CHANGED" />      <protected-broadcast android:name="com.android.bluetooth.btservice.action.ALARM_WAKEUP" />      <protected-broadcast android:name="com.android.server.action.NETWORK_STATS_POLL" />      <protected-broadcast android:name="com.android.server.action.NETWORK_STATS_UPDATED" />      <protected-broadcast android:name="com.android.server.NetworkTimeUpdateService.action.POLL" />      <protected-broadcast android:name="com.android.server.telecom.intent.action.CALLS_ADD_ENTRY" />      <protected-broadcast android:name="com.android.settings.location.MODE_CHANGING" />      <protected-broadcast android:name="com.android.settings.bluetooth.ACTION_DISMISS_PAIRING" />      <protected-broadcast android:name="NotificationManagerService.TIMEOUT" />      <protected-broadcast android:name="ScheduleConditionProvider.EVALUATE" />      <protected-broadcast android:name="EventConditionProvider.EVALUATE" />      <protected-broadcast android:name="SnoozeHelper.EVALUATE" />      <protected-broadcast android:name="wifi_scan_available" />      <protected-broadcast android:name="action.cne.started" />      <protected-broadcast android:name="android.content.jobscheduler.JOB_DEADLINE_EXPIRED" />      <protected-broadcast android:name="android.intent.action.ACTION_UNSOL_RESPONSE_OEM_HOOK_RAW" />      <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE_SUPL" />      <protected-broadcast android:name="android.os.action.LIGHT_DEVICE_IDLE_MODE_CHANGED" />      <protected-broadcast android:name="android.os.storage.action.VOLUME_STATE_CHANGED" />      <protected-broadcast android:name="android.os.storage.action.DISK_SCANNED" />      <protected-broadcast android:name="com.android.server.action.UPDATE_TWILIGHT_STATE" />      <protected-broadcast android:name="com.android.server.action.RESET_TWILIGHT_AUTO" />      <protected-broadcast android:name="com.android.server.device_idle.STEP_IDLE_STATE" />      <protected-broadcast android:name="com.android.server.device_idle.STEP_LIGHT_IDLE_STATE" />      <protected-broadcast android:name="com.android.server.Wifi.action.TOGGLE_PNO" />      <protected-broadcast android:name="intent.action.ACTION_RF_BAND_INFO" />      <protected-broadcast android:name="android.intent.action.MEDIA_RESOURCE_GRANTED" />      <protected-broadcast android:name="android.app.action.NETWORK_LOGS_AVAILABLE" />      <protected-broadcast android:name="android.app.action.SECURITY_LOGS_AVAILABLE" />      <protected-broadcast android:name="android.app.action.INTERRUPTION_FILTER_CHANGED" />      <protected-broadcast android:name="android.app.action.INTERRUPTION_FILTER_CHANGED_INTERNAL" />      <protected-broadcast android:name="android.app.action.NOTIFICATION_POLICY_CHANGED" />      <protected-broadcast android:name="android.app.action.NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED" />      <protected-broadcast android:name="android.os.action.ACTION_EFFECTS_SUPPRESSOR_CHANGED" />      <protected-broadcast android:name="android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED" />      <protected-broadcast android:name="android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED" />      <protected-broadcast android:name="android.app.action.APP_BLOCK_STATE_CHANGED" />      <protected-broadcast android:name="android.permission.GET_APP_GRANTED_URI_PERMISSIONS" />      <protected-broadcast android:name="android.permission.CLEAR_APP_GRANTED_URI_PERMISSIONS" />      <protected-broadcast android:name="android.intent.action.DYNAMIC_SENSOR_CHANGED" />      <protected-broadcast android:name="android.intent.action.ACTION_RADIO_OFF" />      <protected-broadcast android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />      <protected-broadcast android:name="android.accounts.action.ACCOUNT_REMOVED" />      <protected-broadcast android:name="android.accounts.action.VISIBLE_ACCOUNTS_CHANGED" />      <protected-broadcast android:name="com.android.sync.SYNC_CONN_STATUS_CHANGED" />      <protected-broadcast android:name="com.android.phone.SIP_INCOMING_CALL" />      <protected-broadcast android:name="com.android.phone.SIP_ADD_PHONE" />      <protected-broadcast android:name="com.android.phone.SIP_REMOVE_PHONE" />      <protected-broadcast android:name="com.android.phone.SIP_CALL_OPTION_CHANGED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_ACL_CONNECTED" />      <protected-broadcast android:name="android.bluetooth.adapter.action.BLE_ACL_DISCONNECTED" />      <protected-broadcast android:name="android.bluetooth.input.profile.action.HANDSHAKE" />      <protected-broadcast android:name="android.bluetooth.input.profile.action.REPORT" />      <protected-broadcast android:name="android.intent.action.TWILIGHT_CHANGED" />      <protected-broadcast android:name="com.android.server.fingerprint.ACTION_LOCKOUT_RESET" />      <protected-broadcast android:name="android.net.wifi.PASSPOINT_ICON_RECEIVED" />      <protected-broadcast android:name="com.android.server.notification.CountdownConditionProvider" />      <protected-broadcast android:name="com.android.internal.location.ALARM_WAKEUP" />      <protected-broadcast android:name="com.android.internal.location.ALARM_TIMEOUT" />      <protected-broadcast android:name="android.intent.action.GLOBAL_BUTTON" />      <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_AVAILABLE" />      <protected-broadcast android:name="android.intent.action.MANAGED_PROFILE_UNAVAILABLE" />      <protected-broadcast android:name="com.android.server.pm.DISABLE_QUIET_MODE_AFTER_UNLOCK" />      <protected-broadcast android:name="com.android.server.retaildemo.ACTION_RESET_DEMO" />      <protected-broadcast android:name="android.intent.action.DEVICE_LOCKED_CHANGED" />      <!-- Added in O -->      <protected-broadcast android:name="android.app.action.APPLICATION_DELEGATION_SCOPES_CHANGED" />      <protected-broadcast android:name="com.android.server.wm.ACTION_REVOKE_SYSTEM_ALERT_WINDOW_PERMISSION" />      <protected-broadcast android:name="android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED" />      <protected-broadcast android:name="android.content.pm.action.SESSION_COMMITTED" />      <protected-broadcast android:name="android.os.action.USER_RESTRICTIONS_CHANGED" />      <protected-broadcast android:name="android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT" />      <protected-broadcast android:name="android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED" />      <protected-broadcast android:name="android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED" />      <protected-broadcast android:name="android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED" />      <protected-broadcast android:name="com.android.server.inputmethod.InputMethodManagerService.SHOW_INPUT_METHOD_PICKER" />      <!-- Time zone rules update intents fired by the system server -->      <protected-broadcast android:name="com.android.intent.action.timezone.RULES_UPDATE_OPERATION" />      <protected-broadcast android:name="com.android.intent.action.timezone.TRIGGER_RULES_UPDATE_CHECK" />      <!-- Made protected in P (was introduced in JB-MR2) -->      <protected-broadcast android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />      <protected-broadcast android:name="android.telephony.euicc.action.OTA_STATUS_CHANGED" />      <!-- Added in P -->      <protected-broadcast android:name="android.app.action.PROFILE_OWNER_CHANGED" />      <protected-broadcast android:name="android.app.action.TRANSFER_OWNERSHIP_COMPLETE" />      <protected-broadcast android:name="android.app.action.AFFILIATED_PROFILE_TRANSFER_OWNERSHIP_COMPLETE" />      <protected-broadcast android:name="android.app.action.DATA_SHARING_RESTRICTION_CHANGED" />      <protected-broadcast android:name="android.app.action.STATSD_STARTED" />      <protected-broadcast android:name="com.android.server.biometrics.fingerprint.ACTION_LOCKOUT_RESET" />      <protected-broadcast android:name="com.android.server.biometrics.face.ACTION_LOCKOUT_RESET" />      <!-- For IdleController -->      <protected-broadcast android:name="android.intent.action.DOCK_IDLE" />      <protected-broadcast android:name="android.intent.action.DOCK_ACTIVE" />      <!-- Added in Q -->      <protected-broadcast android:name="android.content.pm.action.SESSION_UPDATED" />      <protected-broadcast android:name="android.settings.action.GRAYSCALE_CHANGED" />      <!-- For CarIdlenessTracker -->      <protected-broadcast android:name="com.android.server.jobscheduler.GARAGE_MODE_ON" />      <protected-broadcast android:name="com.android.server.jobscheduler.GARAGE_MODE_OFF" />      <protected-broadcast android:name="com.android.server.jobscheduler.FORCE_IDLE" />      <protected-broadcast android:name="com.android.server.jobscheduler.UNFORCE_IDLE" />      <protected-broadcast android:name="android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL" />      <protected-broadcast android:name="android.intent.action.DEVICE_CUSTOMIZATION_READY" />    ...