summaryrefslogtreecommitdiff
path: root/apct-tests/perftests
diff options
context:
space:
mode:
authorWinson <chiuwinson@google.com>2020-03-10 15:25:32 -0700
committerWinson Chiu <chiuwinson@google.com>2020-04-01 05:42:52 +0000
commit727da64be5c2553753c768d4b309174016968010 (patch)
treef17ec1feb405686348347a919ea3f1c669bc8b3c /apct-tests/perftests
parent63ff5bb6f13f567c7b5eaa24d52b7d78fbf8e7ed (diff)
Gate stricter manifest enforcement on targetSdk R
Two package parsing issues have been promoted to failures in R: a missing <application>/<instrumentation> tag, and an empty "android:name" attribute. The latter due to a bug in the parsing code. These need to be gated by targetSdkVersion so that APKs built for previous versions can still scan/install properly. This change introduces support for this through a framework that leverages @ChangeId to introduce individually toggle-able errors, in case a developer needs to install an app that isn't completely migrated for a new SDK version yet. The ignoreError method was removed from ParseResult as the errors it was used for were manually compared to PackageParser and it's likely they can be hard errors without breaking anything. This also adds tests for general ParseInput/Result behavior. Exempt-From-Owner-Approval: AppIntegrity already approved in older PS. Bug: 150776642 Test: atest android.content.pm.parsing.result.ParseInputAndResultTest Test: atest com.android.server.pm.parsing.PackageParsingDeferErrorTest Test: atest com.android.server.integrity.AppIntegrityManagerServiceImplTest Test: atest com.android.server.pm.parsing Change-Id: Id53a2e65f6e5e4dee9a41cc77007275b3a220ac3
Diffstat (limited to 'apct-tests/perftests')
-rw-r--r--apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt6
1 files changed, 5 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 9e463652d0b6..29721c593646 100644
--- a/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
+++ b/apct-tests/perftests/core/src/android/os/PackageParsingPerfTest.kt
@@ -22,6 +22,7 @@ import android.content.pm.PackageParserCacheHelper.WriteHelper
import android.content.pm.parsing.ParsingPackageImpl
import android.content.pm.parsing.ParsingPackageRead
import android.content.pm.parsing.ParsingPackageUtils
+import android.content.pm.parsing.result.ParseInput
import android.content.pm.parsing.result.ParseTypeImpl
import android.content.res.TypedArray
import android.perftests.utils.BenchmarkState
@@ -173,7 +174,10 @@ class PackageParsingPerfTest {
class ParallelParser2(cacher: PackageCacher2? = null)
: ParallelParser<ParsingPackageRead>(cacher) {
- val input = ThreadLocal.withInitial { ParseTypeImpl() }
+ val input = ThreadLocal.withInitial {
+ // For testing, just disable enforcement to avoid hooking up to compat framework
+ ParseTypeImpl(ParseInput.Callback { _, _, _ -> false })
+ }
val parser = ParsingPackageUtils(false, null, null,
object : ParsingPackageUtils.Callback {
override fun hasFeature(feature: String) = true