diff options
author | 2022-11-22 17:09:26 +0000 | |
---|---|---|
committer | 2022-11-22 17:09:26 +0000 | |
commit | 53e680d2aed09ec290da86006007d9bd2c26ebf3 (patch) | |
tree | a1a79d1db3e9171c77a06cb418c9a533376c458f /java/java_test.go | |
parent | 262d65d481efb37f6d064b6254588fa5ddc313d7 (diff) | |
parent | 757b666c7f7c65e678d93994955d7792a265ba14 (diff) |
Merge "Add min_sdk_version to aidlCmd for droidstubs"
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go index 62c284595..ff1578397 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1370,6 +1370,39 @@ func TestAidlFlagsWithMinSdkVersion(t *testing.T) { } } +func TestAidlFlagsMinSdkVersionDroidstubs(t *testing.T) { + bpTemplate := ` + droidstubs { + name: "foo-stubs", + srcs: ["foo.aidl"], + %s + system_modules: "none", + } + ` + testCases := []struct { + desc string + sdkVersionBp string + minSdkVersionExpected string + }{ + { + desc: "sdk_version not set, module compiles against private platform APIs", + sdkVersionBp: ``, + minSdkVersionExpected: "10000", + }, + { + desc: "sdk_version set to none, module does not build against an SDK", + sdkVersionBp: `sdk_version: "none",`, + minSdkVersionExpected: "10000", + }, + } + for _, tc := range testCases { + ctx := prepareForJavaTest.RunTestWithBp(t, fmt.Sprintf(bpTemplate, tc.sdkVersionBp)) + aidlCmd := ctx.ModuleForTests("foo-stubs", "android_common").Rule("aidl").RuleParams.Command + expected := "--min_sdk_version=" + tc.minSdkVersionExpected + android.AssertStringDoesContain(t, "aidl command conatins incorrect min_sdk_version for testCse: "+tc.desc, aidlCmd, expected) + } +} + func TestAidlEnforcePermissions(t *testing.T) { ctx, _ := testJava(t, ` java_library { |