Merge "Add AIDL compiler to allowed Rust paths" am: 2d815963ba am: 2a3d0ade4c am: 56a8a559ac am: 37045c2c5d am: 5910876e39

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1394307

Change-Id: I12e0fd515a60f135a6e73104d31c61c3f4a8b1ba
diff --git a/apex/allowed_deps.txt b/apex/allowed_deps.txt
index f6b180b..cb47bee 100644
--- a/apex/allowed_deps.txt
+++ b/apex/allowed_deps.txt
@@ -55,17 +55,14 @@
 androidx.activity_activity(minSdkVersion:14)
 androidx.activity_activity-ktx(minSdkVersion:14)
 androidx.annotation_annotation(minSdkVersion:24)
-androidx.annotation_annotation(minSdkVersion:current)
 androidx.appcompat_appcompat(minSdkVersion:14)
 androidx.appcompat_appcompat-resources(minSdkVersion:14)
 androidx.arch.core_core-common(minSdkVersion:24)
-androidx.arch.core_core-common(minSdkVersion:current)
 androidx.arch.core_core-runtime(minSdkVersion:14)
 androidx.asynclayoutinflater_asynclayoutinflater(minSdkVersion:14)
 androidx.autofill_autofill(minSdkVersion:14)
 androidx.cardview_cardview(minSdkVersion:14)
 androidx.collection_collection(minSdkVersion:24)
-androidx.collection_collection(minSdkVersion:current)
 androidx.collection_collection-ktx(minSdkVersion:24)
 androidx.coordinatorlayout_coordinatorlayout(minSdkVersion:14)
 androidx.core_core(minSdkVersion:14)
@@ -85,7 +82,6 @@
 androidx.legacy_legacy-support-v13(minSdkVersion:14)
 androidx.legacy_legacy-support-v4(minSdkVersion:14)
 androidx.lifecycle_lifecycle-common(minSdkVersion:24)
-androidx.lifecycle_lifecycle-common(minSdkVersion:current)
 androidx.lifecycle_lifecycle-common-java8(minSdkVersion:24)
 androidx.lifecycle_lifecycle-extensions(minSdkVersion:14)
 androidx.lifecycle_lifecycle-livedata(minSdkVersion:14)
@@ -215,6 +211,7 @@
 libbacktrace_headers(minSdkVersion:apex_inherit)
 libbase(minSdkVersion:29)
 libbase_headers(minSdkVersion:29)
+libbinder(minSdkVersion:29)
 libbinder_headers(minSdkVersion:29)
 libbinderthreadstateutils(minSdkVersion:29)
 libbluetooth-types-header(minSdkVersion:29)
@@ -228,6 +225,7 @@
 libc_headers(minSdkVersion:apex_inherit)
 libc_headers_arch(minSdkVersion:apex_inherit)
 libcap(minSdkVersion:29)
+libclang_rt.hwasan-aarch64-android.llndk(minSdkVersion:(no version))
 libcodec2(minSdkVersion:29)
 libcodec2_headers(minSdkVersion:29)
 libcodec2_hidl@1.0(minSdkVersion:29)
@@ -340,6 +338,10 @@
 libprocessgroup(minSdkVersion:29)
 libprocessgroup_headers(minSdkVersion:29)
 libprocpartition(minSdkVersion:(no version))
+libprofile-clang-extras(minSdkVersion:(no version))
+libprofile-clang-extras_ndk(minSdkVersion:(no version))
+libprofile-extras(minSdkVersion:(no version))
+libprofile-extras_ndk(minSdkVersion:(no version))
 libprotobuf-cpp-lite(minSdkVersion:29)
 libprotobuf-java-lite(minSdkVersion:current)
 libprotobuf-java-nano(minSdkVersion:9)
@@ -356,6 +358,7 @@
 libstagefright_amrwbenc(minSdkVersion:29)
 libstagefright_bufferpool@2.0.1(minSdkVersion:29)
 libstagefright_bufferqueue_helper(minSdkVersion:29)
+libstagefright_bufferqueue_helper_novndk(minSdkVersion:(no version))
 libstagefright_enc_common(minSdkVersion:29)
 libstagefright_esds(minSdkVersion:29)
 libstagefright_flacdec(minSdkVersion:29)
@@ -381,12 +384,14 @@
 libsysutils(minSdkVersion:apex_inherit)
 libtetherutilsjni(minSdkVersion:current)
 libtextclassifier(minSdkVersion:(no version))
-libtextclassifier-java(minSdkVersion:current)
+libtextclassifier-java(minSdkVersion:28)
+libtextclassifier_flatbuffer_headers(minSdkVersion:(no version))
 libtextclassifier_hash_headers(minSdkVersion:(no version))
 libtextclassifier_hash_static(minSdkVersion:(no version))
 libtflite_kernel_utils(minSdkVersion:(no version))
 libtflite_static(minSdkVersion:(no version))
 libui(minSdkVersion:29)
+libui-types(minSdkVersion:apex_inherit)
 libui_headers(minSdkVersion:29)
 libunwind_llvm(minSdkVersion:apex_inherit)
 libutf(minSdkVersion:(no version))
@@ -412,6 +417,7 @@
 ndk_crtend_so.27(minSdkVersion:(no version))
 ndk_libc++_static(minSdkVersion:(no version))
 ndk_libc++abi(minSdkVersion:(no version))
+ndk_libunwind(minSdkVersion:(no version))
 net-utils-framework-common(minSdkVersion:current)
 netd_aidl_interface-unstable-java(minSdkVersion:29)
 netd_event_listener_interface-ndk_platform(minSdkVersion:29)
diff --git a/apex/apex.go b/apex/apex.go
index b7117ac..4846915 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -189,7 +189,6 @@
 		"ExtServices-core",
 		"ExtServices",
 		"libtextclassifier-java",
-		"libz_current",
 		"textclassifier-statsd",
 		"TextClassifierNotificationLibNoManifest",
 		"TextClassifierServiceLibNoManifest",
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go
index afb739c..314ec8b 100644
--- a/apex/apex_singleton.go
+++ b/apex/apex_singleton.go
@@ -17,9 +17,9 @@
 package apex
 
 import (
-	"android/soong/android"
-
 	"github.com/google/blueprint"
+
+	"android/soong/android"
 )
 
 func init() {
@@ -97,6 +97,8 @@
 			"new_allowed_deps": newAllowedDeps.String(),
 		},
 	})
+
+	ctx.Phony("apex-allowed-deps-check", s.allowedApexDepsInfoCheckResult)
 }
 
 func (s *apexDepsInfoSingleton) MakeVars(ctx android.MakeVarsContext) {
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index 37457e9..1c27146 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -21,7 +21,6 @@
 
 	"android/soong/android"
 	"android/soong/java"
-
 	"github.com/google/blueprint"
 
 	"github.com/google/blueprint/proptools"
@@ -257,9 +256,6 @@
 	// list of commands to create symlinks for backward compatibility.
 	// these commands will be attached as LOCAL_POST_INSTALL_CMD
 	compatSymlinks []string
-
-	hostRequired        []string
-	postInstallCommands []string
 }
 
 type ApexSetProperties struct {
@@ -346,43 +342,21 @@
 	for _, overridden := range a.properties.Overrides {
 		a.compatSymlinks = append(a.compatSymlinks, makeCompatSymlinks(overridden, ctx)...)
 	}
-
-	if ctx.Config().InstallExtraFlattenedApexes() {
-		// flattened apex should be in /system_ext/apex
-		flattenedApexDir := android.PathForModuleInstall(&systemExtContext{ctx}, "apex", a.BaseModuleName())
-		a.postInstallCommands = append(a.postInstallCommands,
-			fmt.Sprintf("$(HOST_OUT_EXECUTABLES)/deapexer --debugfs_path $(HOST_OUT_EXECUTABLES)/debugfs extract %s %s",
-				a.outputApex.String(),
-				flattenedApexDir.ToMakePath().String(),
-			))
-		a.hostRequired = []string{"deapexer", "debugfs"}
-	}
-}
-
-type systemExtContext struct {
-	android.ModuleContext
-}
-
-func (*systemExtContext) SystemExtSpecific() bool {
-	return true
 }
 
 func (a *ApexSet) AndroidMkEntries() []android.AndroidMkEntries {
 	return []android.AndroidMkEntries{android.AndroidMkEntries{
-		Class:         "ETC",
-		OutputFile:    android.OptionalPathForPath(a.outputApex),
-		Include:       "$(BUILD_PREBUILT)",
-		Host_required: a.hostRequired,
+		Class:      "ETC",
+		OutputFile: android.OptionalPathForPath(a.outputApex),
+		Include:    "$(BUILD_PREBUILT)",
 		ExtraEntries: []android.AndroidMkExtraEntriesFunc{
 			func(entries *android.AndroidMkEntries) {
 				entries.SetString("LOCAL_MODULE_PATH", a.installDir.ToMakePath().String())
 				entries.SetString("LOCAL_MODULE_STEM", a.installFilename)
 				entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !a.installable())
 				entries.AddStrings("LOCAL_OVERRIDES_MODULES", a.properties.Overrides...)
-				postInstallCommands := append([]string{}, a.postInstallCommands...)
-				postInstallCommands = append(postInstallCommands, a.compatSymlinks...)
-				if len(postInstallCommands) > 0 {
-					entries.SetString("LOCAL_POST_INSTALL_CMD", strings.Join(postInstallCommands, " && "))
+				if len(a.compatSymlinks) > 0 {
+					entries.SetString("LOCAL_POST_INSTALL_CMD", strings.Join(a.compatSymlinks, " && "))
 				}
 			},
 		},
diff --git a/java/legacy_core_platform_api_usage.go b/java/legacy_core_platform_api_usage.go
index 021920a..df1f643 100644
--- a/java/legacy_core_platform_api_usage.go
+++ b/java/legacy_core_platform_api_usage.go
@@ -19,11 +19,9 @@
 	"android/soong/java/config"
 )
 
-// This variable is effectively unused in pre-master branches, and is
-// included (with the same value as it has in AOSP) only to ease
-// merges between branches (see the comment in the
-// useLegacyCorePlatformApi() function):
 var legacyCorePlatformApiModules = []string{
+	"AAECarSystemUI",
+	"AAECarSystemUI-tests",
 	"ahat-test-dump",
 	"android.car",
 	"android.test.mock",
@@ -33,16 +31,34 @@
 	"api-stubs-docs",
 	"art_cts_jvmti_test_library",
 	"art-gtest-jars-MyClassNatives",
+	"atfwd",
+	"BackupEncryption",
 	"BackupFrameworksServicesRoboTests",
+	"backuplib",
 	"BandwidthEnforcementTest",
 	"BlockedNumberProvider",
 	"BluetoothInstrumentationTests",
+	"BluetoothMidiLib",
 	"BluetoothMidiService",
-	"car-apps-common",
+	"BTTestApp",
+	"CallEnhancement",
+	"CapCtrlInterface",
+	"CarService",
+	"car-service-test-lib",
+	"car-service-test-static-lib",
 	"CertInstaller",
+	"com.qti.location.sdk",
+	"com.qti.media.secureprocessor",
+	"com.qti.snapdragon.sdk.display",
+	"ConfURIDialer",
 	"ConnectivityManagerTest",
 	"ContactsProvider",
+	"CorePerfTests",
 	"core-tests-support",
+	"cronet_impl_common_java",
+	"cronet_impl_native_java",
+	"cronet_impl_platform_java",
+	"CtsAppExitTestCases",
 	"CtsContentTestCases",
 	"CtsIkeTestCases",
 	"CtsLibcoreWycheproofBCTestCases",
@@ -50,10 +66,17 @@
 	"CtsNetTestCases",
 	"CtsNetTestCasesLatestSdk",
 	"CtsSecurityTestCases",
+	"CtsSuspendAppsTestCases",
 	"CtsUsageStatsTestCases",
+	"datastatusnotification",
+	"DeadpoolService",
+	"DeadpoolServiceBtServices",
+	"DeviceInfo",
 	"DisplayCutoutEmulationEmu01Overlay",
+	"DocumentsUIGoogleTests",
 	"DocumentsUIPerfTests",
 	"DocumentsUITests",
+	"DocumentsUIUnitTests",
 	"DownloadProvider",
 	"DownloadProviderTests",
 	"DownloadProviderUi",
@@ -62,10 +85,12 @@
 	"ethernet-service",
 	"EthernetServiceTests",
 	"ExternalStorageProvider",
-	"ExtServices",
-	"ExtServices-core",
+	"face-V1-0-javalib",
+	"FloralClocks",
 	"framework-all",
+	"framework-jobscheduler",
 	"framework-minus-apex",
+	"FrameworkOverlayG6QU3",
 	"FrameworksCoreTests",
 	"FrameworksIkeTests",
 	"FrameworksNetCommonTests",
@@ -73,28 +98,65 @@
 	"FrameworksServicesRoboTests",
 	"FrameworksServicesTests",
 	"FrameworksUtilTests",
+	"FrameworksWifiTests",
+	"GtsIncrementalInstallTestCases",
+	"GtsIncrementalInstallTriggerApp",
+	"GtsInstallerV2TestCases",
+	"HelloOslo",
 	"hid",
 	"hidl_test_java_java",
 	"hwbinder",
 	"ims",
+	"ims-ext-common",
+	"imssettings",
+	"izat.lib.glue",
 	"KeyChain",
-	"ksoap2",
+	"LocalSettingsLib",
 	"LocalTransport",
 	"lockagent",
 	"mediaframeworktest",
-	"MediaProvider",
+	"mediatek-ims-base",
 	"MmsService",
-	"MtpDocumentsProvider",
+	"ModemTestMode",
+	"MtkCapCtrl",
+	"MtpService",
 	"MultiDisplayProvider",
+	"my.tests.snapdragonsdktest",
+	"NetworkSetting",
 	"NetworkStackIntegrationTestsLib",
 	"NetworkStackNextIntegrationTests",
 	"NetworkStackNextTests",
 	"NetworkStackTests",
 	"NetworkStackTestsLib",
 	"NfcNci",
+	"online-gcm-ref-docs",
+	"online-gts-docs",
+	"PerformanceMode",
+	"pixel-power-ext-java",
+	"pixel-power-ext-unstable-java",
+	"pixel-power-ext-V1-java",
 	"platform_library-docs",
+	"PowerStatsService",
 	"PrintSpooler",
+	"pxp-monitor",
+	"QColor",
+	"qcom.fmradio",
+	"qcrilhook",
+	"qcrilhook-static",
+	"qcrilmsgtunnel",
+	"QDCMMobileApp",
+	"Qmmi",
+	"QPerformance",
+	"QtiTelephonyService",
+	"QtiTelephonyServicelibrary",
+	"remoteSimLockAuthentication",
+	"remotesimlockmanagerlibrary",
 	"RollbackTest",
+	"sam",
+	"saminterfacelibrary",
+	"sammanagerlibrary",
+	"service-blobstore",
+	"service-jobscheduler",
 	"services",
 	"services.accessibility",
 	"services.backup",
@@ -104,21 +166,55 @@
 	"services.usage",
 	"services.usb",
 	"Settings-core",
+	"SettingsGoogleOverlayCoral",
+	"SettingsGoogleOverlayFlame",
 	"SettingsLib",
+	"SettingsOverlayG013A",
+	"SettingsOverlayG013B",
+	"SettingsOverlayG013C",
+	"SettingsOverlayG013D",
+	"SettingsOverlayG020A",
+	"SettingsOverlayG020B",
+	"SettingsOverlayG020C",
+	"SettingsOverlayG020D",
+	"SettingsOverlayG020E",
+	"SettingsOverlayG020E_VN",
+	"SettingsOverlayG020F",
+	"SettingsOverlayG020F_VN",
+	"SettingsOverlayG020G",
+	"SettingsOverlayG020G_VN",
+	"SettingsOverlayG020H",
+	"SettingsOverlayG020H_VN",
+	"SettingsOverlayG020I",
+	"SettingsOverlayG020I_VN",
+	"SettingsOverlayG020J",
+	"SettingsOverlayG020M",
+	"SettingsOverlayG020N",
+	"SettingsOverlayG020P",
+	"SettingsOverlayG020Q",
+	"SettingsOverlayG025H",
+	"SettingsOverlayG025J",
+	"SettingsOverlayG025M",
+	"SettingsOverlayG025N",
+	"SettingsOverlayG5NZ6",
 	"SettingsProvider",
 	"SettingsProviderTest",
 	"SettingsRoboTests",
 	"Shell",
 	"ShellTests",
+	"SimContact",
+	"SimContacts",
+	"SimSettings",
 	"sl4a.Common",
 	"StatementService",
 	"SystemUI-core",
 	"SystemUISharedLib",
 	"SystemUI-tests",
+	"tcmiface",
 	"Telecom",
 	"TelecomUnitTests",
 	"telephony-common",
-	"TelephonyProvider",
+	"telephony-ext",
 	"TelephonyProviderTests",
 	"TeleService",
 	"testables",
@@ -128,18 +224,19 @@
 	"time_zone_distro_installer-tests",
 	"time_zone_distro-tests",
 	"time_zone_updater",
+	"TMobilePlanProvider",
 	"TvProvider",
 	"uiautomator-stubs-docs",
+	"uimgbamanagerlibrary",
 	"UsbHostExternalManagementTestApp",
 	"UserDictionaryProvider",
+	"UxPerformance",
 	"WallpaperBackup",
-	"wifi-service",
+	"WallpaperBackupAgentTests",
+	"WfdCommon",
+	"xdivert",
 }
 
-// This variable is effectively unused in pre-master branches, and is
-// included (with the same value as it has in AOSP) only to ease
-// merges between branches (see the comment in the
-// useLegacyCorePlatformApi() function):
 var legacyCorePlatformApiLookup = make(map[string]struct{})
 
 func init() {
@@ -149,12 +246,8 @@
 }
 
 func useLegacyCorePlatformApi(ctx android.EarlyModuleContext) bool {
-	// In pre-master branches, we don't attempt to force usage of the stable
-	// version of the core/platform API. Instead, we always use the legacy
-	// version --- except in tests, where we always use stable, so that we
-	// can make the test assertions the same as other branches.
-	// This should be false in tests and true otherwise:
-	return ctx.Config().TestProductVariables == nil
+	_, found := legacyCorePlatformApiLookup[ctx.ModuleName()]
+	return found
 }
 
 func corePlatformSystemModules(ctx android.EarlyModuleContext) string {