2

I have created an application that receives BOOT_COMPLETED within a receiver using the following filter:

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

I receive this on one device but I have another device that does not receive this despite using the same APK. What device-specific issues could prevent a particular device from receiving this intent? Is there any way to test for this and create a remedy?

gonzobrains
  • 7,856
  • 14
  • 81
  • 132
  • What device is it in particular, that does not receive this intent? – Ahmad Jun 20 '13 at 19:04
  • It is a proprietary device, but both devices I am testing on are the same hardware revision. Can I tell from logcat or something else why there would be a difference between the two? – gonzobrains Jun 20 '13 at 22:53

2 Answers2

2

Make sure that you are doing a real full reboot.

Some HTC devices, for example, have a "fast boot" mode that does not trigger BOOT_COMPLETED, but instead sends an android.intent.action.QUICKBOOT_POWERON broadcast. As I understand it, the "fast boot" mode basically does a hibernate, instead of a true power down, and so they don't send BOOT_COMPLETED as a result.

(why the Intent action isn't com.htc.action.QUICKBOOT_POWERON is a whole `nuther issue...)

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Is this "fast boot" mode what many apps in the Google Play store perform when they claim to reboot one's device? My device only offers the standard "Power off" feature displayed along with "Airplane mode" when its hardware power switch is depressed. – gonzobrains Jun 20 '13 at 23:02
  • @gonzobrains: "Is this "fast boot" mode what many apps in the Google Play store perform when they claim to reboot one's device?" -- beats me. You can't reboot the device from an app without root, and I don't usually run root. "My device only offers the standard "Power off" feature" -- my understanding is that HTC's "fast boot" option is something you toggle somewhere in Settings. – CommonsWare Jun 20 '13 at 23:07
  • 1
    Okay. I ask because my Galaxy Relay 4G actually offers a "Reboot" option along with "Power off" which restarts the device much faster than powering off and powering back on. I'm not sure if that is the equivalent of an "adb reboot" or if it is something different. As for "restart" apps, I think they are just gimmicks that just simulate a reboot since they don't have root access. – gonzobrains Jun 20 '13 at 23:22
2

Some devices after Android 3.1 will not give the app control after the BOOT_COMPLETED receiver.

Google has long said that users should launch an activity from the launcher first, before that application can go do much. Preventing BOOT_COMPLETED from being delivered until the first activity is launched is a logical extension of the same argument.

I do not know which devices it makes a difference on though.

Schaab18
  • 31
  • 4
  • The strange thing is that both my devices are of the same hardware platform. The only differences I can image would be firmware revisions and/or other apps installed that may be interfering. – gonzobrains Jun 20 '13 at 22:54