UserDataPreparer: only delete contents of user's system CE and DE dirs
The /data/system_ce/$userId and /data/system_de/$userId directories are
created by vold, so they should be deleted by vold as well, and in fact
that would already happen except that system_server deletes them
recursively before vold gets to it. Change system_server to delete just
the contents of these directories.
This is a prerequisite to locking down the ability to create these
directories (https://r.android.com/2078213), which is needed to stop
subdirectories from accidentally being created too early. Technically
we could achieve this goal without limiting delete access, as it's
create access that really matters, but having the operations be paired
properly is much cleaner.
Test: Created and deleted a user, and verified that all their
directories still got deleted.
Test: atest UserDataPreparerTest
Bug: 156305599
Change-Id: Iec908e1bc15a00c7179fcd1d80321c315682d339
2 files changed