Revert "Pass --non-updatable-system flag to aapt2 when versionCode is unspecified"
This reverts commit ce320f86a0
.
Reason for revert: <Dorid monitor: Likely culprit for b/347143262 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.>
Change-Id: I70eabe014acc6feb123f28ac487f7d7d39e9fb6b
This commit is contained in:
committed by
Gerrit Code Review
parent
ce320f86a0
commit
0b6d6fe9b2
@@ -4477,54 +4477,5 @@ func TestAppMinSdkVersionOverride(t *testing.T) {
|
||||
fooOverride.BuildParams.Args["args"],
|
||||
"--minSdkVersion 33",
|
||||
)
|
||||
}
|
||||
|
||||
func TestNonUpdatableSystem(t *testing.T) {
|
||||
ctx := testApp(t, `
|
||||
android_app {
|
||||
name: "foo",
|
||||
srcs: ["a.java"],
|
||||
sdk_version: "current",
|
||||
aaptflags: [
|
||||
"--version-code 1",
|
||||
],
|
||||
}
|
||||
android_app {
|
||||
name: "bar",
|
||||
srcs: ["a.java"],
|
||||
sdk_version: "current",
|
||||
}
|
||||
android_test {
|
||||
name: "baz",
|
||||
srcs: ["a.java"],
|
||||
sdk_version: "current",
|
||||
}
|
||||
android_test_helper_app {
|
||||
name: "baz_helper",
|
||||
srcs: ["a.java"],
|
||||
sdk_version: "current",
|
||||
}
|
||||
`)
|
||||
|
||||
hasNonUpdatableSystemFlag := func(module android.TestingModule) bool {
|
||||
moduleAapt2LinkRule := module.Rule("android/soong/java.aapt2Link")
|
||||
linkFlags := moduleAapt2LinkRule.Args["flags"]
|
||||
return strings.Contains(linkFlags, "--non-updatable-system")
|
||||
}
|
||||
|
||||
foo := ctx.ModuleForTests("foo", "android_common")
|
||||
android.AssertBoolEquals(t, "app should not pass `--non-updatable-flags` when --version-code is specified",
|
||||
false, hasNonUpdatableSystemFlag(foo))
|
||||
|
||||
bar := ctx.ModuleForTests("bar", "android_common")
|
||||
android.AssertBoolEquals(t, "app should pass `--non-updatable-flags` when --version-code is not specified",
|
||||
true, hasNonUpdatableSystemFlag(bar))
|
||||
|
||||
baz := ctx.ModuleForTests("baz", "android_common")
|
||||
android.AssertBoolEquals(t, "test should not pass `--non-updatable-flags` even if --version-code is not specified",
|
||||
false, hasNonUpdatableSystemFlag(baz))
|
||||
|
||||
baz_helper := ctx.ModuleForTests("baz_helper", "android_common")
|
||||
android.AssertBoolEquals(t, "test should not pass `--non-updatable-flags` even if --version-code is not specified",
|
||||
false, hasNonUpdatableSystemFlag(baz_helper))
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user