diff options
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r-- | apex/apex_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index da6214db3..153ee3108 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -11670,3 +11670,48 @@ func TestSdkLibraryTransitiveClassLoaderContext(t *testing.T) { } `) } + +// If an apex sets system_ext_specific: true, its systemserverclasspath libraries must set this property as well. +func TestApexSSCPJarMustBeInSamePartitionAsApex(t *testing.T) { + testApexError(t, `foo is an apex systemserver jar, but its partition does not match the partition of its containing apex`, ` + apex { + name: "myapex", + key: "myapex.key", + systemserverclasspath_fragments: [ + "mysystemserverclasspathfragment", + ], + min_sdk_version: "29", + updatable: true, + system_ext_specific: true, + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + + java_library { + name: "foo", + srcs: ["b.java"], + min_sdk_version: "29", + installable: true, + apex_available: [ + "myapex", + ], + sdk_version: "current", + } + + systemserverclasspath_fragment { + name: "mysystemserverclasspathfragment", + contents: [ + "foo", + ], + apex_available: [ + "myapex", + ], + } + `, + dexpreopt.FixtureSetApexSystemServerJars("myapex:foo"), + ) +} |