summaryrefslogtreecommitdiff
path: root/apct-tests/perftests
diff options
context:
space:
mode:
authorHai Zhang <zhanghai@google.com>2021-01-27 14:39:33 -0800
committerHai Zhang <zhanghai@google.com>2021-02-02 11:42:40 -0800
commitf61f4fb849297eb9415242a907ab9f1369b2d428 (patch)
tree2264120273fb1920e0bea9780a351603ea3a544a /apct-tests/perftests
parentb23f6d71eea725045dd1c4bef9e2fc98b0ecfa8e (diff)
Pass in split permissions to ParsingPackageUtils.
Similar to passing in display metrics. We can use ActivityThread.currentApplication() as the context for getting PermissionManager in system server process because it will be created early in ActivityThread.attach() before any custom logic can run, but it becomes a problem for apps because they can run their own logic by overriding Application.attachBaseContext() and do things there before ActivityThread.currentApplication() becomes non-null. So pass in the split permissions explicitly as an external dependency for ParsingPackageUtils, and move the getPackageArchiveInfo() implementation from PackageManager to ApplicationPackageManager to utilize the context there. PackageParser2 can get the split permissions internally because it's only used in system server. Fixes: 178155985 Test: manual Change-Id: I8213cf752e16b08328ad1150b2639da18c5d0e83 (cherry picked from commit 7b8974d375c74ff228d71b1f038f48cfb46c6d7c)
Diffstat (limited to 'apct-tests/perftests')
-rw-r--r--apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
index 9e519f7afb93..1d94d7e8eca2 100644
--- a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
+++ b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
@@ -178,7 +178,7 @@ class PackageParsingPerfTest {
// For testing, just disable enforcement to avoid hooking up to compat framework
ParseTypeImpl(ParseInput.Callback { _, _, _ -> false })
}
- val parser = ParsingPackageUtils(false, null, null,
+ val parser = ParsingPackageUtils(false, null, null, emptyList(),
object : ParsingPackageUtils.Callback {
override fun hasFeature(feature: String) = true