Support migrating app data to a new appId

Add logic in installd to recursively chown an app's internal data and
profile directory to its new appId. In the case of an app upgrade and
the user profile is unlocked, the previous appId is passed over to
verify and only chown files that the app owns.

Bug: 179284822
Test: to be included with CL in framework/base
Change-Id: I11d9bed9fc8dc3179c4936001450b452ddce8a75
4 files changed