Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 45fb6c68 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Handle corrupt packages.xml

If the device hard reboots or is otherwise killed
between write and fsync of packages.xml, it can write all zeros. This is
not a problem in most cases as packages.xml is renamed to
packages-backup.xml before writing begins. In the case (boot after a
failed first boot) that a packages.xml does not exist, we may read that
all 0 packages.xml. In such a case we will encounter IOExceptions and
will not get the opportunity to build the VersionInfos that we require
later during boot.

This change adds a finally block for those exception cases to populate
the VersionInfos to adequately handle subsequent stages of boot.

Fixes: 178518634
Bug: 178518634
Test: manual; adb shell 'stop; rm /data/system/packages.xml; fallocate -l 1K /data/system/packages.xml; start'
Change-Id: I532b2bcd5b739345c8cd2e3f3a3d9a6393f68fba
parent 7c6e169d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment