Hi We are working on an android application where we are using reboot receiver in which I am starting few services where I am performaning some network operation.
I
Xiomi has a reported bug for only using this reciever 5 minutes after the system
actually boot-up -
http://xiaomi.eu/community/threads/alarmmanager-_wakeup-problem.21430/
You can try and add the -
android:enabled="true"
and android:exported="true"
even though they should be set to true by default due to manufacturer system changes
it might be different on Xiomi android customized OS.
Just pay attention for their meaning
Since the android:exported="true"
Will let other applications access to your reciever.
There is an internal feature of MIUI which prevents apps from restarting for saving battery & RAM. You have to manually toggle Auto Start option on in order to receive broadcast for BOOT_COMPLETED. Go to Settings> Installed Apps> Your App. Then just toggle on the auto start option. There is no option to prevent this programmatically. Instead, you can inform your app's users if they face problems while using your app (ex: Alarm is not triggering properly), they can enable Auto Start from Settings.
Add this in your manifest file in intent-filter
<action android:name="android.intent.action.BOOT_COMPLETED" />
I was suggesting to add android:enabled="true" but it was already offered.
So I can tell you that you first make sure yourself if the receiver registered properly or not. You can also try the other version of registering it - that is doing registration programmatically (preferably in onPause() & onResume()) and see if it's receiving the broadcast message or not.
Ok, let's try again. MIUI has a a built-in Security app. In the Security app there is a 'Startup' section, where the user can configure which app can and which app can't run on startup. Your application is disabled default. Also if you examine your Logcat you can see a "permission denied" message at startup. Put your app manually to the whitelisted apps, unfortunately that is your users can only do.
you should see here. In Xiaomi devices, they block some permissions even if you require it. The only way to slove it is you must allow your app this permission manually.