My Android app needs to be notified about the BOOT_COMPLETED
event. AndroidManifest.xml contains <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
and inside <application>
tag I have the following receiver definition:
<receiver android:name=".OnBootReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
Is the android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
required? What happens if it is not in place, is there a risk of any application being able to simulate the boot event and invoking my app?
In some examples, the receiver contains the RECEIVE_BOOT_COMPLETED permission and some the receiver does not. Are there API level specific differences?
Copyright Notice:Content Author:「Juuso Ohtonen」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/35268088/broadcastreceiver-requires-android-permission-receive-boot-completed