Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.HEADSET_PLUG
crash information:
Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.HEADSET_PLUG from
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
ActivityManagerService.java:
if (AppGlobals.getPackageManager().isProtectedBroadcast( //whether the protected broadcastion
intent.getAction())) { //判断是否是受保护的广播
String msg = "Permission Denial: not allowed to send broadcast "
+ intent.getAction() + " from pid="
+ callingPid + ", uid=" + callingUid;
Slog.w(TAG, msg);
throw new SecurityException(msg);
} else if (AppWidgetManager.ACTION_APPWIDGET_CONFIGURE.equals(intent.getAction())) {
.....
}
}
This is protected intent that can only be sent by the system.
frameworks/base/core/res/AndroidManifest.xml
<!-- ================================================ -->
<!-- Special broadcasts that only the system can send -->
<!-- ================================================ -->
<protected-broadcast android:name="android.intent.action.HEADSET_PLUG" />
<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.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_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.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.LOCALE_CHANGED" /> <protected-broadcast android:name="android.intent.action.BATTERY_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.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.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.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.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.backup.intent.RUN" /> <protected-broadcast android:name="android.backup.intent.CLEAR" /> <protected-broadcast android:name="android.backup.intent.INIT" /> <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.CONNECTION_STATE_CHANGED" /> <protected-broadcast android:name="android.bluetooth.device.action.UUID" /> <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.DISAPPEARED" /> <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.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.a2dp.profile.action.CONNECTION_STATE_CHANGED" /> <protected-broadcast android:name="android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED" /> <protected-broadcast android:name="android.bluetooth.input.profile.action.CONNECTION_STATE_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.pan.profile.action.CONNECTION_STATE_CHANGED" /> <protected-broadcast android:name="android.bluetooth.pbap.intent.action.PBAP_STATE_CHANGED" /> <protected-broadcast android:name="android.btopp.intent.action.INCOMING_FILE_NOTIFICATION" /> <protected-broadcast android:name="android.btopp.intent.action.BT_OPP_HANDOVER_STARTED" /> <protected-broadcast android:name="android.btopp.intent.action.TRANSFER_COMPLETE" /> <protected-broadcast android:name="android.btopp.intent.action.USER_CONFIRMATION_TIMEOUT" /> <protected-broadcast android:name="android.btopp.intent.action.BT_OPP_TRANSFER_PROGRESS" /> <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.BT_OPP_TRANSFER_DONE" /> <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="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="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_ACCESSORY_ATTACHED" /> <protected-broadcast android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /> <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.intent.action.ANALOG_AUDIO_DOCK_PLUG" /> <protected-broadcast android:name="android.intent.action.DIGITAL_AUDIO_DOCK_PLUG" /> <protected-broadcast android:name="android.intent.action.HDMI_AUDIO_PLUG" /> <protected-broadcast android:name="android.intent.action.USB_AUDIO_ACCESSORY_PLUG" /> <protected-broadcast android:name="android.intent.action.USB_AUDIO_DEVICE_PLUG" /> <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.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.CONNECTIVITY_CHANGE" /> <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.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.LLCP_LINK_STATE_CHANGED" /> <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" /> <protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" /> <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="android.intent.action.DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN" /> <protected-broadcast android:name="com.android.server.WifiManager.action.START_SCAN" /> <protected-broadcast android:name="com.android.server.WifiManager.action.DELAYED_DRIVER_STOP" /> <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_SCAN_AVAILABLE" /> <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.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.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.BUGREPORT_FINISHED" /> <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="android.intent.action.HDMI_PLUGGED" /> <protected-broadcast android:name="android.intent.action.PHONE_STATE" /> <protected-broadcast android:name="android.location.GPS_ENABLED_CHANGE" /> <protected-broadcast android:name="android.location.PROVIDERS_CHANGED" /> <protected-broadcast android:name="android.location.MODE_CHANGED" /> <protected-broadcast android:name="android.location.GPS_FIX_CHANGE" /> <protected-broadcast android:name="android.net.proxy.PAC_REFRESH" /> <protected-broadcast android:name="com.android.server.connectivityservice.CONNECTED_TO_PROVISIONING_NETWORK_ACTION" />
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。