Preserve ownership and permissions when copying apex data.
This changes snapshot and restore in apexd to use cp when copying
files. This allows the "-p" option to be used to preserve
ownership, permissions, and timestamps, and is similar to how
this is done in installd.
A restorecon is also added when restoring a snapshot to ensure that
the correct SELinux types are applied.
Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeUser
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_Ce
Test: manual test, set owners and permissions on files in data directories,
checked preserved after snapshot & restore
Change-Id: I75519dcf266f78ffe58d93628cba8d87b84545c2
4 files changed