0

I am not running this on an emulator, but an actual Android Device (Google Pixel 3).

If I issue this command: am broadcast -a android.intent.action.BOOT_COMPLETED

I get the output :

> Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED
> flg=0x400000 } Broadcast completed: result=0

I was expecting the device to reboot. Does this mean that the broadcast isn't working?

1 Answers1

1

I was expecting the device to reboot.

That broadcast does not reboot the device. It is a broadcast, sent by the system, after the device has booted.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • https://stackoverflow.com/questions/11325920/how-to-test-boot-completed-broadcast-receiver-in-emulator – Harshit Kumar Feb 18 '20 at 23:36
  • Is that a normal broadcast result. I just want to make sure that the event is broadcasted. – Harshit Kumar Feb 18 '20 at 23:38
  • @HarshitKumar: "Is that a normal broadcast result" -- it looks OK. A better test would be to have a receiver registered to receive that broadcast, then see if it received your test broadcast. – CommonsWare Feb 18 '20 at 23:39
  • There should be apps on the phone which have the `BOOT_COMPLETED` broadcast registered. Is there any observation I can make through which I can decide the broadcast was transmitted. I am not an Android app developer. – Harshit Kumar Feb 18 '20 at 23:43
  • @HarshitKumar: "Is there any observation I can make through which I can decide the broadcast was transmitted" -- I have no way of answering that. – CommonsWare Feb 18 '20 at 23:44