How to know if the boot is after FOTA update

228 views
Skip to first unread message

Prem C

unread,
Jul 28, 2015, 10:48:12 AM7/28/15
to android-platform
There are different types of system boot like:

1. FirstBoot -> Can be found using isFirstBoot() method from PackageManagerService.java

2. Normal Boot -> Which is just a reboot performed by user, which can be found using "not of isFirstBoot()"

3. FOTA Boot -> Which is a boot performed after FOTA upgrade.

Is there any flag or method which tells the boot is a FOTA boot.

There is a support for Package Manager which knows that the boot is a FOTA boot and it tries to update the system and Launcher and other things.

But I am unable to know how Package Manager gets to know this information.

Any suggestion on this will be really helpful.


Thank u.

Dave Smith

unread,
Jul 28, 2015, 11:14:35 AM7/28/15
to android-...@googlegroups.com
I believe the hook you are looking for is the ACTION_PRE_BOOT_COMPLETED broadcast. This is the event that is fired by AM during the system/application upgrade process after an OTA. The broadcast also has the FLAG_RECEIVER_BOOT_UPGRADE set so you can distinguish between other events where the pre-boot broadcast fires.
@devunwired

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Prem C

unread,
Jul 30, 2015, 8:33:12 AM7/30/15
to android-platform, dasmi...@gmail.com
@Dave, thank you for your valuable reply.

The answer u gave doesn't hold when there is only some system file change after OTA, which is not reflected by Activity Manager.
Activity manager also sends this broadcast only to particular registered components.

Any idea if there is any GLOBAL value saying the boot is after OTA.

Thank u

Chris Tate

unread,
Jul 30, 2015, 5:15:18 PM7/30/15
to android-platform, Dave Smith
Any application can store a copy of the build fingerprint, and see if that has changed since the last time it ran.  This is not entirely reliable (someone might technically apply a new flashed system that did not change the fingerprint), but is at least a positive signal that the system *was* changed.

The big question here is why any application would need to know this.

--
christopher tate

Reply all
Reply to author
Forward
0 new messages