Skip to content
Commit eff2ae20 authored by Winson Chiu's avatar Winson Chiu
Browse files

Expose Environment device/credential encrypted app storage directories

ApplicationInfo is expensive to build, especially when using the
new PackageState APIs which don't require ApplicationInfo at all.

To allow access to the dataDir field without ApplicationInfo, this
exposes methods on Environment to build them dynamically based on
volume UUID, user, and app package name. This avoids having to
build/cache the strings in system server and consolidates the
file system related APIs into Environment as a single source of
truth.

This also fixes the @TestApi StorageManager#convert so that its
String parameter is marked @Nullable, which works because
UUID_PRIVATE_INTERNAL is defined as nullable. This allows the method
to be used in Kotlin, as the Kotlin compiler will enforce nullability
annotations, preventing the UUID_PRIVATE_INTERNAL value from being
tested without the right annotation on the parameter.

Bug: 245943991

Test: atest android.os.EnvironmentTest
Test: atest android.os.cts.EnvironmentTest

Change-Id: I5983ee22a27f566352fd0de03f0ee421a0bc390f
parent e36b1ca4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment