5

I am getting the following message from the logcat:

08-16 11:34:36.257: W/BroadcastQueue(1040):
 Unable to launch app com.abc.xyz/10192 for broadcast Intent
 { act=android.intent.action.BOOT_COMPLETED flg=0x8000010 (has extras) }: process is not permitted to autostart

My manifest.xml looks like this:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> 
<receiver android:name="com.abc.xyz.BootComplete" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
        </intent-filter>
</receiver>

I have tried so many methods but its not working.I know there is some other problem.Thanks.

dev
  • 1,343
  • 2
  • 19
  • 40
BulletProof47
  • 141
  • 3
  • 11

3 Answers3

3

On Xiamoi your application will be blocked from autostart on reboot by default (unlike it Facebook or Whatsapp, that allowed to run). As a user you can change this limitation in built in Security application, in Manage apps -> -> Autostart. As a developer, I didn't found the answer.

Borg8
  • 1,562
  • 11
  • 19
1

I developed a library that helps a user add your app to autostart, you can check it out here.

AutoStarter

Jude Fernandes
  • 7,437
  • 11
  • 53
  • 90
1

On Xiaomi devices, you can open the screen for users to enable autostart permission with the following code:

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
startActivity(intent);

I'm aware this is an old question but it might be useful for someone