'Android detect Quick Boot / Turn On on MTCD units

i'm writing a little software for MTCD units.

It's a service that updates a widget.

In order to start automatically the service on boot I used, in the Android Manifest file, a receiver for the android.intent.action.BOOT_COMPLETED.

<receiver

    android:name=".BootReceiver"

    android:enabled="true"

    android:exported="true">

    <intent-filter>

        <action android:name="android.intent.action.BOOT_COMPLETED" />

        <action android:name="android.intent.action.QUICKBOOT_POWERON" />

        <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />

    </intent-filter>

</receiver>

The BootReceiver works great and launchs the service.

I have an issue with the "rapid boot". When the Android HeadUnit turns off and remains off for few seconds or few minutes on wake-up (rapid boot) the services is not running anymore (because the service was killed during the power off stand-by phase).

Instead, if the HeadUnit remains off for many minutes and then it performs a FULL BOOT (the long boot) the service starts perfectly because is receiving the BOOT_COMPLETED.

Do you know which intent I have to "listen" in order to launch the service after a rapid boot / wake-up?

Thank you,

Salvo



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source