OSDN Git Service

Offer to "fixup" GIDs used for app data.
authorJeff Sharkey <jsharkey@android.com>
Mon, 3 Apr 2017 22:41:02 +0000 (16:41 -0600)
committerJeff Sharkey <jsharkey@android.com>
Mon, 3 Apr 2017 22:41:08 +0000 (16:41 -0600)
commite12d5964a8d14abe7f2eb6e57469cbe7f7391a19
treea9ed18ab9487d9c7a74adc8d0687dac049082253
parent623912183d8314595b37cdedc7c193a21c345bdb
Offer to "fixup" GIDs used for app data.

We recently started tracking cached app data using a per-app GID for
the "cache" and "code_cache" directories and their contents.  For
upgraded devices, we ideally want to "fixup" the GIDs of any existing
data while the device is still showing the boot animation, instead of
blocking the user when they unlock the device.

Since all the information we need is available in metadata, we can
update GIDs before the user has unlocked data.  We're pretty paranoid
and we only pivot between the normal app GID and the cache GID; any
other GID values are ignored.

This "fixup" method can also be used in the future to ensure
consistency of the files on disk.  Also fix bug by always using
"fts_path" instead of "fts_accpath" which is based on racy chdir().

Test: /data/nativetest/installd_service_test/installd_service_test
Bug: 3420111135084485
Change-Id: Ia52694f3763cba09926082c08f0766477e03e39c
cmds/installd/InstalldNativeService.cpp
cmds/installd/InstalldNativeService.h
cmds/installd/binder/android/os/IInstalld.aidl
cmds/installd/tests/Android.bp
cmds/installd/tests/installd_service_test.cpp [new file with mode: 0644]
cmds/installd/utils.cpp
cmds/installd/utils.h