PackageCacher: cache key for block-device APEX
PackageCacher manages its cache based on package filename. When an APEX
is mounted from a device-mapper block device, it creates a cache with a
block device filename (e.g. dm-17), which is not stable. The number can
change even if the APEX itsef is not changed.
Instead, PackageCacher can use the device mapper name for its cache key
if a given package is a device mapper block device because the device
name is stable across reboots. The device name can be read from sysfs
(e.g. /sys/block/dm-17/dm/name).
In this change, PackageCacher uses a device-mapper name as a cache key
if a given package is a device-mapper device.
Bug: 427589794
Flag: com.android.apex.flags.mount_before_data
Test: adb install <APEX> && reboot
Test: adb shell ls /data/system/package_cache/{hash}
Change-Id: Iea9cdc5a4128d7c1f7440737b419ed9e2252d009
Loading
Please register or sign in to comment