diff options
author | 2025-02-07 01:37:56 -0800 | |
---|---|---|
committer | 2025-02-07 01:37:57 -0800 | |
commit | 7a57092288dc873c982dac1086ee06aa7ffb49f6 (patch) | |
tree | c5bd44db386b2f00d7e97af41999677e65f22e1b | |
parent | de7428141f39fcc4473b4e342458812845e62d58 (diff) |
Revert "Move MutateApexTransition shortcut later"
Revert submission 3477737-move_apex_shortcut
Reason for revert: Likely culprit for b/394990888 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted changes: /q/submissionid:3477737-move_apex_shortcut
Change-Id: I67459460e847451d06e733a01249e3dd8017a2e0
-rw-r--r-- | android/apex.go | 19 | ||||
-rw-r--r-- | cc/testing.go | 4 | ||||
-rw-r--r-- | sdk/bootclasspath_fragment_sdk_test.go | 9 | ||||
-rw-r--r-- | sdk/cc_sdk_test.go | 25 | ||||
-rw-r--r-- | sdk/systemserverclasspath_fragment_sdk_test.go | 12 |
5 files changed, 17 insertions, 52 deletions
diff --git a/android/apex.go b/android/apex.go index a5ccd520e..c2f73a9c1 100644 --- a/android/apex.go +++ b/android/apex.go @@ -616,26 +616,25 @@ func MutateApexTransition(ctx BaseModuleContext, variation string) { apexInfos = allApexInfos.ApexInfos } - if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() { - // Do not install the module for platform, but still allow it to output - // uninstallable AndroidMk entries in certain cases when they have side - // effects. TODO(jiyong): move this routine to somewhere else - module.MakeUninstallable() + // Shortcut + if len(apexInfos) == 0 { + return } // Do some validity checks. // TODO(jiyong): is this the right place? base.checkApexAvailableProperty(ctx) - // Shortcut - if len(apexInfos) == 0 { - return - } - if !module.UniqueApexVariations() && !base.ApexProperties.UniqueApexVariationsForDeps { apexInfos, _ = mergeApexVariations(apexInfos) } + if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() { + // Do not install the module for platform, but still allow it to output + // uninstallable AndroidMk entries in certain cases when they have side + // effects. TODO(jiyong): move this routine to somewhere else + module.MakeUninstallable() + } if !platformVariation { var thisApexInfo ApexInfo diff --git a/cc/testing.go b/cc/testing.go index c9d362da2..14a6b7a6a 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -193,7 +193,7 @@ func commonDefaultModules() string { }, apex_available: [ "//apex_available:platform", - "//apex_available:anyapex", + "myapex" ], llndk: { symbol_file: "libm.map.txt", @@ -253,7 +253,7 @@ func commonDefaultModules() string { }, apex_available: [ "//apex_available:platform", - "//apex_available:anyapex", + "myapex" ], llndk: { symbol_file: "libdl.map.txt", diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go index ad315bfd0..36f001065 100644 --- a/sdk/bootclasspath_fragment_sdk_test.go +++ b/sdk/bootclasspath_fragment_sdk_test.go @@ -759,13 +759,6 @@ func TestBasicSdkWithBootclasspathFragment(t *testing.T) { bootclasspath_fragments: ["mybootclasspathfragment"], } - apex { - name: "myapex", - key: "myapex.key", - min_sdk_version: "1", - bootclasspath_fragments: ["mybootclasspathfragment"], - } - bootclasspath_fragment { name: "mybootclasspathfragment", image_name: "art", @@ -808,7 +801,7 @@ func TestBasicSdkWithBootclasspathFragment(t *testing.T) { java_import { name: "mybootlib", visibility: ["//visibility:public"], - apex_available: ["myapex"], + apex_available: ["com.android.art"], jars: ["java/mybootlib.jar"], } `), diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index 5bac67da6..939477f61 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -805,19 +805,13 @@ func TestSnapshotWithCcSharedLibrary(t *testing.T) { native_shared_libs: ["mynativelib"], } - apex { - name: "myapex", - key: "myapex.key", - min_sdk_version: "1", - } - cc_library_shared { name: "mynativelib", srcs: [ "Test.cpp", "aidl/foo/bar/Test.aidl", ], - apex_available: ["myapex"], + apex_available: ["apex1", "apex2"], export_include_dirs: ["myinclude"], aidl: { export_aidl_headers: true, @@ -827,18 +821,6 @@ func TestSnapshotWithCcSharedLibrary(t *testing.T) { `) CheckSnapshot(t, result, "mysdk", "", - snapshotTestPreparer(checkSnapshotWithoutSource, - android.FixtureMergeMockFs(android.MockFS{ - "myapex/Android.bp": []byte(` - apex { - name: "myapex", - key: "myapex.key", - min_sdk_version: "1", - } - `), - "myapex/apex_manifest.json": nil, - }), - ), checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -851,7 +833,10 @@ cc_prebuilt_library_shared { name: "mynativelib", prefer: false, visibility: ["//visibility:public"], - apex_available: ["myapex"], + apex_available: [ + "apex1", + "apex2", + ], stl: "none", compile_multilib: "both", export_include_dirs: ["include/myinclude"], diff --git a/sdk/systemserverclasspath_fragment_sdk_test.go b/sdk/systemserverclasspath_fragment_sdk_test.go index 7ebdcd4c3..60e5b9521 100644 --- a/sdk/systemserverclasspath_fragment_sdk_test.go +++ b/sdk/systemserverclasspath_fragment_sdk_test.go @@ -87,18 +87,6 @@ func testSnapshotWithSystemServerClasspathFragment(t *testing.T, sdk string, tar CheckSnapshot(t, result, "mysdk", "", checkAndroidBpContents(expectedSdkSnapshot), - snapshotTestPreparer(checkSnapshotWithoutSource, - android.FixtureMergeMockFs(android.MockFS{ - "myapex/Android.bp": []byte(` - apex { - name: "myapex", - key: "myapex.key", - min_sdk_version: "1", - } - `), - "myapex/apex_manifest.json": nil, - }), - ), ) } |