Merge changes I4ab7e1a3,Ib525b2f5,I2d4c54fb into rvc-dev

* changes:
  Generate combined deps-info for all updatable modules.
  Remove ApexBundleDepsInfo.MinSdkVersion()
  Add "updatable" property to ApexModule interface.
This commit is contained in:
Artur Satayev
2020-05-27 20:58:27 +00:00
committed by Android (Google) Code Review
7 changed files with 148 additions and 28 deletions

View File

@@ -4437,6 +4437,13 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg, bp string, transformDe
"system/sepolicy/apex/some-updatable-apex-file_contexts",
],
}
filegroup {
name: "some-non-updatable-apex-file_contexts",
srcs: [
"system/sepolicy/apex/some-non-updatable-apex-file_contexts",
],
}
`
bp += cc.GatherRequiredDepsForTest(android.Android)
bp += java.GatherRequiredDepsForTest()
@@ -4449,6 +4456,7 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg, bp string, transformDe
"apex_manifest.json": nil,
"AndroidManifest.xml": nil,
"system/sepolicy/apex/some-updatable-apex-file_contexts": nil,
"system/sepolicy/apex/some-non-updatable-apex-file_contexts": nil,
"system/sepolicy/apex/com.android.art.something-file_contexts": nil,
"framework/aidl/a.aidl": nil,
}
@@ -4519,6 +4527,14 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
],
}
java_library {
name: "some-non-updatable-apex-lib",
srcs: ["a.java"],
apex_available: [
"some-non-updatable-apex",
],
}
java_library {
name: "some-platform-lib",
srcs: ["a.java"],
@@ -4540,16 +4556,30 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
name: "some-updatable-apex",
key: "some-updatable-apex.key",
java_libs: ["some-updatable-apex-lib"],
updatable: true,
min_sdk_version: "current",
}
apex {
name: "some-non-updatable-apex",
key: "some-non-updatable-apex.key",
java_libs: ["some-non-updatable-apex-lib"],
}
apex_key {
name: "some-updatable-apex.key",
}
apex_key {
name: "some-non-updatable-apex.key",
}
apex {
name: "com.android.art.something",
key: "com.android.art.something.key",
java_libs: ["some-art-lib"],
updatable: true,
min_sdk_version: "current",
}
apex_key {
@@ -4580,6 +4610,13 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// non-updatable jar from some other apex in the ART boot image => error
error = "module 'some-non-updatable-apex-lib' is not allowed in the ART boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-non-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// updatable jar from some other apex in the framework boot image => error
error = "module 'some-updatable-apex-lib' from updatable apex 'some-updatable-apex' is not allowed in the framework boot image"
transform = func(config *dexpreopt.GlobalConfig) {
@@ -4587,6 +4624,12 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
}
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// non-updatable jar from some other apex in the framework boot image => ok
transform = func(config *dexpreopt.GlobalConfig) {
config.BootJars = []string{"some-non-updatable-apex-lib"}
}
testNoUpdatableJarsInBootImage(t, "", bp, transform)
// nonexistent jar in the ART boot image => error
error = "failed to find a dex jar path for module 'nonexistent'"
transform = func(config *dexpreopt.GlobalConfig) {
@@ -4602,7 +4645,7 @@ func TestNoUpdatableJarsInBootImage(t *testing.T) {
testNoUpdatableJarsInBootImage(t, error, bp, transform)
// platform jar in the ART boot image => error
error = "module 'some-platform-lib' is part of the platform and not allowed in the ART boot image"
error = "module 'some-platform-lib' is not allowed in the ART boot image"
transform = func(config *dexpreopt.GlobalConfig) {
config.ArtApexJars = []string{"some-platform-lib"}
}