Revert "Make the enabled property configurable"

Revert submission 27162921-configurable_enabled_property

Reason for revert: Droid-monitor created revert due to Build breakage in b/338253720. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:27162921-configurable_enabled_property

Change-Id: I2d144f9d297373a13a1190b173d10c966181ad84
diff --git a/java/app_import_test.go b/java/app_import_test.go
index 496fc13..5de50e7 100644
--- a/java/app_import_test.go
+++ b/java/app_import_test.go
@@ -509,7 +509,7 @@
 
 			variant := ctx.ModuleForTests("foo", "android_common")
 			if test.expected == "" {
-				if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) {
+				if variant.Module().Enabled() {
 					t.Error("module should have been disabled, but wasn't")
 				}
 				rule := variant.MaybeRule("genProvenanceMetaData")
@@ -586,7 +586,7 @@
 
 			variant := ctx.ModuleForTests("foo", "android_common")
 			if test.expected == "" {
-				if variant.Module().Enabled(android.PanickingConfigAndErrorContext(ctx)) {
+				if variant.Module().Enabled() {
 					t.Error("module should have been disabled, but wasn't")
 				}
 				rule := variant.MaybeRule("genProvenanceMetaData")
@@ -629,7 +629,7 @@
 	if !a.prebuilt.UsePrebuilt() {
 		t.Errorf("prebuilt foo module is not active")
 	}
-	if !a.Enabled(android.PanickingConfigAndErrorContext(ctx)) {
+	if !a.Enabled() {
 		t.Errorf("prebuilt foo module is disabled")
 	}
 }
diff --git a/java/boot_jars.go b/java/boot_jars.go
index 6223ded..5d40ec3 100644
--- a/java/boot_jars.go
+++ b/java/boot_jars.go
@@ -21,8 +21,8 @@
 // isActiveModule returns true if the given module should be considered for boot
 // jars, i.e. if it's enabled and the preferred one in case of source and
 // prebuilt alternatives.
-func isActiveModule(ctx android.ConfigAndErrorContext, module android.Module) bool {
-	if !module.Enabled(ctx) {
+func isActiveModule(module android.Module) bool {
+	if !module.Enabled() {
 		return false
 	}
 	return android.IsModulePreferred(module)
diff --git a/java/bootclasspath.go b/java/bootclasspath.go
index 77ddf5c..c7dc3af 100644
--- a/java/bootclasspath.go
+++ b/java/bootclasspath.go
@@ -127,10 +127,7 @@
 // added by addDependencyOntoApexModulePair.
 func gatherApexModulePairDepsWithTag(ctx android.BaseModuleContext, tag blueprint.DependencyTag) []android.Module {
 	var modules []android.Module
-	isActiveModulePred := func(module android.Module) bool {
-		return isActiveModule(ctx, module)
-	}
-	ctx.VisitDirectDepsIf(isActiveModulePred, func(module android.Module) {
+	ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) {
 		t := ctx.OtherModuleDependencyTag(module)
 		if t == tag {
 			modules = append(modules, module)
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 82a34ca..cc3da76 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -474,7 +474,7 @@
 	// Only perform a consistency check if this module is the active module. That will prevent an
 	// unused prebuilt that was created without instrumentation from breaking an instrumentation
 	// build.
-	if isActiveModule(ctx, ctx.Module()) {
+	if isActiveModule(ctx.Module()) {
 		b.bootclasspathFragmentPropertyCheck(ctx)
 	}
 
@@ -519,7 +519,7 @@
 // empty string if this module should not provide a boot image profile.
 func (b *BootclasspathFragmentModule) getProfileProviderApex(ctx android.BaseModuleContext) string {
 	// Only use the profile from the module that is preferred.
-	if !isActiveModule(ctx, ctx.Module()) {
+	if !isActiveModule(ctx.Module()) {
 		return ""
 	}
 
@@ -590,7 +590,7 @@
 		// So ignore it even if it is not in PRODUCT_APEX_BOOT_JARS.
 		// TODO(b/202896428): Add better way to handle this.
 		_, unknown = android.RemoveFromList("android.car-module", unknown)
-		if isActiveModule(ctx, ctx.Module()) && len(unknown) > 0 {
+		if isActiveModule(ctx.Module()) && len(unknown) > 0 {
 			ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown)
 		}
 	}
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 7229ca0..f7e3cb9 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -562,7 +562,7 @@
 	return ctx.Config().Once(dexBootJarsFragmentsKey, func() interface{} {
 		fragments := make(map[string]android.Module)
 		ctx.WalkDeps(func(child, parent android.Module) bool {
-			if !isActiveModule(ctx, child) {
+			if !isActiveModule(child) {
 				return false
 			}
 			tag := ctx.OtherModuleDependencyTag(child)
@@ -1125,7 +1125,7 @@
 	image.unstrippedInstalls = unstrippedInstalls
 
 	// Only set the licenseMetadataFile from the active module.
-	if isActiveModule(ctx, ctx.Module()) {
+	if isActiveModule(ctx.Module()) {
 		image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile())
 	}
 
diff --git a/java/fuzz.go b/java/fuzz.go
index 78ab108..fb31ce7 100644
--- a/java/fuzz.go
+++ b/java/fuzz.go
@@ -69,13 +69,13 @@
 
 	android.AddLoadHook(module, func(ctx android.LoadHookContext) {
 		disableLinuxBionic := struct {
-			Enabled proptools.Configurable[bool]
-		}{
-			Enabled: android.CreateSelectOsToBool(map[string]*bool{
-				"":             nil,
-				"linux_bionic": proptools.BoolPtr(false),
-			}),
-		}
+			Target struct {
+				Linux_bionic struct {
+					Enabled *bool
+				}
+			}
+		}{}
+		disableLinuxBionic.Target.Linux_bionic.Enabled = proptools.BoolPtr(false)
 		ctx.AppendProperties(&disableLinuxBionic)
 	})
 
@@ -179,7 +179,7 @@
 			javaFuzzModule.ApexModuleBase,
 		}
 
-		if ok := fuzz.IsValid(ctx, fuzzModuleValidator); !ok {
+		if ok := fuzz.IsValid(fuzzModuleValidator); !ok {
 			return
 		}
 
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index cab5402..ae587ea 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -1428,7 +1428,7 @@
 		// should not contribute to anything. So, rather than have a missing dex jar cause a Soong
 		// failure defer the error reporting to Ninja. Unless the prebuilt build target is explicitly
 		// built Ninja should never use the dex jar file.
-		if !isActiveModule(ctx, module) {
+		if !isActiveModule(module) {
 			return true
 		}
 
diff --git a/java/jacoco.go b/java/jacoco.go
index 696a0cc..a820b38 100644
--- a/java/jacoco.go
+++ b/java/jacoco.go
@@ -53,7 +53,7 @@
 	}
 
 	j, ok := ctx.Module().(instrumentable)
-	if !ctx.Module().Enabled(ctx) || !ok {
+	if !ctx.Module().Enabled() || !ok {
 		return
 	}
 
diff --git a/java/jdeps.go b/java/jdeps.go
index 3400263..91f7ce7 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -48,7 +48,7 @@
 	moduleInfos := make(map[string]android.IdeInfo)
 
 	ctx.VisitAllModules(func(module android.Module) {
-		if !module.Enabled(ctx) {
+		if !module.Enabled() {
 			return
 		}
 
diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go
index 99fa092..2fc6c02 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -19,7 +19,6 @@
 	"path/filepath"
 
 	"android/soong/android"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 )
@@ -234,7 +233,7 @@
 	var compatConfigMetadata android.Paths
 
 	ctx.VisitAllModules(func(module android.Module) {
-		if !module.Enabled(ctx) {
+		if !module.Enabled() {
 			return
 		}
 		if c, ok := module.(platformCompatConfigMetadataProvider); ok {
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 2b6c8f8..113071f 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -2294,7 +2294,7 @@
 // once for public API level and once for system API level
 func (module *SdkLibrary) CreateInternalModules(mctx android.DefaultableHookContext) {
 	// If the module has been disabled then don't create any child modules.
-	if !module.Enabled(mctx) {
+	if !module.Enabled() {
 		return
 	}