Receive broadcast even when app is not running

245 views
Skip to first unread message

mushahidg...@gmail.com

unread,
Oct 12, 2020, 11:18:13 AM10/12/20
to android-platform
Problem: My application is listening for broadcast ACTION_APPLICATION_RESTRICTIONS_CHANGED, this action start to receive when i launch the application for the first time after app is installed
Note: Broadcast is registered explicitly in the background service and app is signed with platform keys

Questions: 
1: How can i receive the broadcast even if i do not launch the app for the first time?
2: What changes i requires in the AOSP to make it work ?

Thanks!!

Regards,
Mushahid

Kushtrim Pacaj

unread,
Oct 19, 2020, 10:56:51 AM10/19/20
to android-platform
You need to find that broadcast where it is sent, and add FLAG_RECEIVER_INCLUDE_BACKGROUND and FLAG_INCLUDE_STOPPED_PACKAGES flags to it.
It will cause
Reply all
Reply to author
Forward
0 new messages