Restrict legacy apps to download files in private app dirs

Legacy apps with WRITE permission could write to other app's private app
Note: Legacy apps can still write to other app's Android/media package
directories, but non-legacy apps cannot.

Bug: 200813547
Test: atest HelpersTest
Change-Id: Iebd5eb9ba9047f49f7645163a3b9bb83cd9ed214
Merged-In: Iebd5eb9ba9047f49f7645163a3b9bb83cd9ed214
(cherry picked from commit 3e4947a7ff9d29d3aa1c89b5b0b986897a96ce8d)
3 files changed