I’m encountering an issue with starting an IntentService from one application to another on a Redmi device. The problem occurs only on Redmi devices and is related to background restrictions.
Description:
I’m using IntentService
, Handler
, and Messenger
for communication between two applications. When the target application is in a closed state, I attempt to trigger the IntentService
and receive the following log message:
Background start not allowed: service Intent { cmp=com.example.project/.nonui.services.UploadDataService (has extras) } to com.example.project/.nonui.services.UploadDataService from pid=9276 uid=10620 pkg=com.example.project startFg?=true
This issue is specific to Redmi devices; the service works as expected on other devices.
Details:
-
The
IntentService
is declared in the Android manifest. -
I am using min SDK version 26 and target SDK version 30.
-
I am using a Foreground Service for handling intents.
-
Background restrictions might be affecting the service on Redmi devices.
Additional Information:
-
I have tried enabling the background autostart setting for the apps, but the issue persists when triggering the
IntentService
for the first time while the app is in a closed state. -
I’ve checked the device settings for battery optimization but haven’t found a resolution.
-
I am aware that Redmi devices might have additional background limitations or optimizations.
Questions:
-
How can I resolve the “Background start not allowed” issue on Redmi devices?
-
Are there any specific considerations for background services on Xiaomi devices with MIUI?
-
What steps can I take to ensure that the
IntentService
is triggered correctly even when the app is closed?
Sujana Sri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.