diff options
author | 2025-01-21 15:38:58 -0800 | |
---|---|---|
committer | 2025-02-03 22:19:24 -0800 | |
commit | 1115b4bf39bb343d3bb2b47d2796496bac13e61e (patch) | |
tree | 509465326be642eba4e8500cd68a09af39494de8 /android/apex_test.go | |
parent | e5c7d7c59e63919e9b6ccd655c35fc5371a8bce9 (diff) |
Don't merge apex variations with different UsePlatformApis
Merging apex variations with different UsePlatformApis results in
the presence of an extra apex with UsePlatformApis false changing
the behavior of an existing apex -> module dependency with
UsePlatformApis true, which can't be supported with incremental
analysis. Don't merge apex variations with different UsePlatformApis
values, and add a _p suffix to the UsePlatformApis variation so they
can coexist.
Test: Test_mergeApexVariations
Bug: 372543712
Change-Id: I0e857a646a0449f87e4de6e6306ec921bc46fac1
Diffstat (limited to 'android/apex_test.go')
-rw-r--r-- | android/apex_test.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/android/apex_test.go b/android/apex_test.go index 78597b234..acc195de2 100644 --- a/android/apex_test.go +++ b/android/apex_test.go @@ -193,7 +193,7 @@ func Test_mergeApexVariations(t *testing.T) { }, }, { - name: "merge different UsePlatformApis but don't allow using platform api", + name: "don't merge different UsePlatformApis", in: []ApexInfo{ { ApexVariationName: "foo", @@ -213,13 +213,20 @@ func Test_mergeApexVariations(t *testing.T) { { ApexVariationName: "apex10000", MinSdkVersion: FutureApiLevel, - InApexVariants: []string{"foo", "bar"}, + InApexVariants: []string{"foo"}, + ForPrebuiltApex: NotForPrebuiltApex, + }, + { + ApexVariationName: "apex10000_p", + MinSdkVersion: FutureApiLevel, + UsePlatformApis: true, + InApexVariants: []string{"bar"}, ForPrebuiltApex: NotForPrebuiltApex, }, }, wantAliases: [][2]string{ {"foo", "apex10000"}, - {"bar", "apex10000"}, + {"bar", "apex10000_p"}, }, }, { @@ -242,7 +249,7 @@ func Test_mergeApexVariations(t *testing.T) { }, wantMerged: []ApexInfo{ { - ApexVariationName: "apex10000", + ApexVariationName: "apex10000_p", MinSdkVersion: FutureApiLevel, UsePlatformApis: true, InApexVariants: []string{"foo", "bar"}, @@ -250,8 +257,8 @@ func Test_mergeApexVariations(t *testing.T) { }, }, wantAliases: [][2]string{ - {"foo", "apex10000"}, - {"bar", "apex10000"}, + {"foo", "apex10000_p"}, + {"bar", "apex10000_p"}, }, }, } |