Skip to content
Commit 3582259c authored by Neil Fuller's avatar Neil Fuller
Browse files

Avoid potential failure to boot with bad storage

Discovered by inspection: It is possible in the
event of file system issues to throw an exception
on boot.

This change moves logic previously done in the
PackageStatusStorage constructor to an initialize()
method that can be called on service start up and
handled more gracefully: if there is a storage problem
a warning will be logged and time zone updates
feature will just not be enabled.

Also:
Commit a7d21f8c
switched to FileUtils.createDir() but the mkdir()
(implied by createDir()) wasn't removed along with
it but was redundant.

Units tests run with:

atest FrameworksServiceTestsCases:PackageStatusStorageTest \
    FrameworksServiceTestsCases:PackageTrackerTest

Test: See above
Test: PTS: run pts -m PtsTimeZoneTestCases
Test: Manual test: deleted /data/system/timezone and rebooted, dir
recreated
Change-Id: I84ab3152d0a9d6781e5665e8615b3ab92b6c7a40
parent a7d21f8c
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