Merge changes from topic "bb_201948713"

* changes:
  Revert "Support generating sdk snapshot for specific build release"
  Revert "Separate hidden API flags needed in sdk snapshots for S and T"
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 5eb7acf..420489e 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -5058,9 +5058,8 @@
 				annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 				metadata: "my-bootclasspath-fragment/metadata.csv",
 				index: "my-bootclasspath-fragment/index.csv",
-				signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-				filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-				filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+				stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+				all_flags: "my-bootclasspath-fragment/all-flags.csv",
 			},
 		}
 
@@ -5110,9 +5109,8 @@
 				annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 				metadata: "my-bootclasspath-fragment/metadata.csv",
 				index: "my-bootclasspath-fragment/index.csv",
-				signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-				filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-				filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+				stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+				all_flags: "my-bootclasspath-fragment/all-flags.csv",
 			},
 		}
 
@@ -5240,9 +5238,8 @@
 				annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 				metadata: "my-bootclasspath-fragment/metadata.csv",
 				index: "my-bootclasspath-fragment/index.csv",
-				signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-				filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-				filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+				stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+				all_flags: "my-bootclasspath-fragment/all-flags.csv",
 			},
 		}
 
@@ -5327,9 +5324,8 @@
 				annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 				metadata: "my-bootclasspath-fragment/metadata.csv",
 				index: "my-bootclasspath-fragment/index.csv",
-				signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-				filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-				filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+				stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+				all_flags: "my-bootclasspath-fragment/all-flags.csv",
 			},
 		}
 
@@ -5412,9 +5408,8 @@
 				annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 				metadata: "my-bootclasspath-fragment/metadata.csv",
 				index: "my-bootclasspath-fragment/index.csv",
-				signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-				filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-				filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+				stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+				all_flags: "my-bootclasspath-fragment/all-flags.csv",
 			},
 		}
 
@@ -7446,9 +7441,8 @@
 					annotation_flags: "my-bootclasspath-fragment/annotation-flags.csv",
 					metadata: "my-bootclasspath-fragment/metadata.csv",
 					index: "my-bootclasspath-fragment/index.csv",
-					signature_patterns: "my-bootclasspath-fragment/signature-patterns.csv",
-					filtered_stub_flags: "my-bootclasspath-fragment/filtered-stub-flags.csv",
-					filtered_flags: "my-bootclasspath-fragment/filtered-flags.csv",
+					stub_flags: "my-bootclasspath-fragment/stub-flags.csv",
+					all_flags: "my-bootclasspath-fragment/all-flags.csv",
 				},
 			}
 
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 20bbff3..79c73ca 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -767,20 +767,14 @@
 	// The path to the generated index.csv file.
 	Index_path android.OptionalPath
 
+	// The path to the generated signature-patterns.csv file.
+	Signature_patterns_path android.OptionalPath
+
 	// The path to the generated stub-flags.csv file.
-	Stub_flags_path android.OptionalPath `supported_build_releases:"S"`
+	Stub_flags_path android.OptionalPath
 
 	// The path to the generated all-flags.csv file.
-	All_flags_path android.OptionalPath `supported_build_releases:"S"`
-
-	// The path to the generated signature-patterns.csv file.
-	Signature_patterns_path android.OptionalPath `supported_build_releases:"T+"`
-
-	// The path to the generated filtered-stub-flags.csv file.
-	Filtered_stub_flags_path android.OptionalPath `supported_build_releases:"T+"`
-
-	// The path to the generated filtered-flags.csv file.
-	Filtered_flags_path android.OptionalPath `supported_build_releases:"T+"`
+	All_flags_path android.OptionalPath
 }
 
 func (b *bootclasspathFragmentSdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
@@ -799,13 +793,10 @@
 	b.Metadata_path = android.OptionalPathForPath(hiddenAPIInfo.MetadataPath)
 	b.Index_path = android.OptionalPathForPath(hiddenAPIInfo.IndexPath)
 
+	b.Signature_patterns_path = android.OptionalPathForPath(hiddenAPIInfo.SignaturePatternsPath)
 	b.Stub_flags_path = android.OptionalPathForPath(hiddenAPIInfo.StubFlagsPath)
 	b.All_flags_path = android.OptionalPathForPath(hiddenAPIInfo.AllFlagsPath)
 
-	b.Signature_patterns_path = android.OptionalPathForPath(hiddenAPIInfo.SignaturePatternsPath)
-	b.Filtered_stub_flags_path = android.OptionalPathForPath(hiddenAPIInfo.FilteredStubFlagsPath)
-	b.Filtered_flags_path = android.OptionalPathForPath(hiddenAPIInfo.FilteredFlagsPath)
-
 	// Copy stub_libs properties.
 	b.Stub_libs = module.properties.Api.Stub_libs
 	b.Core_platform_stub_libs = module.properties.Core_platform_api.Stub_libs
@@ -870,13 +861,9 @@
 	copyOptionalPath(b.Annotation_flags_path, "annotation_flags")
 	copyOptionalPath(b.Metadata_path, "metadata")
 	copyOptionalPath(b.Index_path, "index")
-
+	copyOptionalPath(b.Signature_patterns_path, "signature_patterns")
 	copyOptionalPath(b.Stub_flags_path, "stub_flags")
 	copyOptionalPath(b.All_flags_path, "all_flags")
-
-	copyOptionalPath(b.Signature_patterns_path, "signature_patterns")
-	copyOptionalPath(b.Filtered_stub_flags_path, "filtered_stub_flags")
-	copyOptionalPath(b.Filtered_flags_path, "filtered_flags")
 }
 
 var _ android.SdkMemberType = (*bootclasspathFragmentMemberType)(nil)
@@ -902,12 +889,6 @@
 
 		// The path to the all-flags.csv file created by the bootclasspath_fragment.
 		All_flags *string `android:"path"`
-
-		// The path to the filtered-stub-flags.csv file created by the bootclasspath_fragment.
-		Filtered_stub_flags *string `android:"path"`
-
-		// The path to the filtered-flags.csv file created by the bootclasspath_fragment.
-		Filtered_flags *string `android:"path"`
 	}
 }
 
@@ -934,7 +915,7 @@
 
 // produceHiddenAPIOutput returns a path to the prebuilt all-flags.csv or nil if none is specified.
 func (module *prebuiltBootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleContext, contents []android.Module, input HiddenAPIFlagInput) *HiddenAPIOutput {
-	pathForOptionalSrc := func(src *string, defaultPath android.Path) android.Path {
+	pathForOptionalSrc := func(src *string) android.Path {
 		if src == nil {
 			return nil
 		}
@@ -957,19 +938,13 @@
 			AnnotationFlagsPath:   pathForSrc("hidden_api.annotation_flags", module.prebuiltProperties.Hidden_api.Annotation_flags),
 			MetadataPath:          pathForSrc("hidden_api.metadata", module.prebuiltProperties.Hidden_api.Metadata),
 			IndexPath:             pathForSrc("hidden_api.index", module.prebuiltProperties.Hidden_api.Index),
-			SignaturePatternsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Signature_patterns, nil),
-			// TODO: Temporarily handle stub_flags/all_flags properties until prebuilts have been updated.
-			StubFlagsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Stub_flags, nil),
-			AllFlagsPath:  pathForOptionalSrc(module.prebuiltProperties.Hidden_api.All_flags, nil),
+			SignaturePatternsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Signature_patterns),
+			StubFlagsPath:         pathForSrc("hidden_api.stub_flags", module.prebuiltProperties.Hidden_api.Stub_flags),
+			AllFlagsPath:          pathForSrc("hidden_api.all_flags", module.prebuiltProperties.Hidden_api.All_flags),
 		},
-
 		EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
 	}
 
-	// TODO: Temporarily fallback to stub_flags/all_flags properties until prebuilts have been updated.
-	output.FilteredStubFlagsPath = pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Filtered_stub_flags, output.StubFlagsPath)
-	output.FilteredFlagsPath = pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Filtered_flags, output.AllFlagsPath)
-
 	return &output
 }
 
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index f1e30f3..b9a1ca7 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -548,18 +548,18 @@
 	}
 }
 
-// StubFlagSubset returns a SignatureCsvSubset that contains a path to a filtered-stub-flags.csv
-// file and a path to a signature-patterns.csv file that defines a subset of the monolithic stub
-// flags file, i.e. out/soong/hiddenapi/hiddenapi-stub-flags.txt, against which it will be compared.
+// StubFlagSubset returns a SignatureCsvSubset that contains a path to a stub-flags.csv file and a
+// path to a signature-patterns.csv file that defines a subset of the monolithic stub flags file,
+// i.e. out/soong/hiddenapi/hiddenapi-stub-flags.txt, against which it will be compared.
 func (i *HiddenAPIInfo) StubFlagSubset() SignatureCsvSubset {
-	return SignatureCsvSubset{i.FilteredStubFlagsPath, i.SignaturePatternsPath}
+	return SignatureCsvSubset{i.StubFlagsPath, i.SignaturePatternsPath}
 }
 
-// FlagSubset returns a SignatureCsvSubset that contains a path to a filtered-flags.csv file and a
+// FlagSubset returns a SignatureCsvSubset that contains a path to an all-flags.csv file and a
 // path to a signature-patterns.csv file that defines a subset of the monolithic flags file, i.e.
 // out/soong/hiddenapi/hiddenapi-flags.csv, against which it will be compared.
 func (i *HiddenAPIInfo) FlagSubset() SignatureCsvSubset {
-	return SignatureCsvSubset{i.FilteredFlagsPath, i.SignaturePatternsPath}
+	return SignatureCsvSubset{i.AllFlagsPath, i.SignaturePatternsPath}
 }
 
 var HiddenAPIInfoProvider = blueprint.NewProvider(HiddenAPIInfo{})
@@ -784,6 +784,9 @@
 // HiddenAPIFlagOutput contains paths to output files from the hidden API flag generation for a
 // bootclasspath_fragment module.
 type HiddenAPIFlagOutput struct {
+	// The path to the generated stub-flags.csv file.
+	StubFlagsPath android.Path
+
 	// The path to the generated annotation-flags.csv file.
 	AnnotationFlagsPath android.Path
 
@@ -793,21 +796,12 @@
 	// The path to the generated index.csv file.
 	IndexPath android.Path
 
-	// The path to the generated stub-flags.csv file.
-	StubFlagsPath android.Path
-
 	// The path to the generated all-flags.csv file.
 	AllFlagsPath android.Path
 
 	// The path to the generated signature-patterns.txt file which defines the subset of the
 	// monolithic hidden API files provided in this.
 	SignaturePatternsPath android.Path
-
-	// The path to the generated filtered-stub-flags.csv file.
-	FilteredStubFlagsPath android.Path
-
-	// The path to the generated filtered-flags.csv file.
-	FilteredFlagsPath android.Path
 }
 
 // bootDexJarByModule is a map from base module name (without prebuilt_ prefix) to the boot dex
@@ -1073,13 +1067,11 @@
 	// Store the paths in the info for use by other modules and sdk snapshot generation.
 	output := HiddenAPIOutput{
 		HiddenAPIFlagOutput: HiddenAPIFlagOutput{
-			AnnotationFlagsPath:   annotationFlagsCSV,
-			MetadataPath:          metadataCSV,
-			IndexPath:             indexCSV,
-			StubFlagsPath:         stubFlagsCSV,
-			AllFlagsPath:          allFlagsCSV,
-			FilteredStubFlagsPath: filteredStubFlagsCSV,
-			FilteredFlagsPath:     filteredFlagsCSV,
+			StubFlagsPath:       filteredStubFlagsCSV,
+			AnnotationFlagsPath: annotationFlagsCSV,
+			MetadataPath:        metadataCSV,
+			IndexPath:           indexCSV,
+			AllFlagsPath:        filteredFlagsCSV,
 		},
 		EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
 	}
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go
index ff2af43..e1ae474 100644
--- a/sdk/bootclasspath_fragment_sdk_test.go
+++ b/sdk/bootclasspath_fragment_sdk_test.go
@@ -138,8 +138,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
@@ -166,8 +166,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
@@ -339,8 +339,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
@@ -424,8 +424,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
@@ -649,8 +649,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
@@ -852,8 +852,8 @@
         metadata: "hiddenapi/metadata.csv",
         index: "hiddenapi/index.csv",
         signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
+        stub_flags: "hiddenapi/filtered-stub-flags.csv",
+        all_flags: "hiddenapi/filtered-flags.csv",
     },
 }
 
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index 83294f6..85e3d87 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -21,7 +21,6 @@
 	"testing"
 
 	"android/soong/android"
-	"android/soong/java"
 
 	"github.com/google/blueprint/proptools"
 )
@@ -707,86 +706,4 @@
 			snapshotTestPreparer(checkSnapshotWithoutSource, android.FixtureWithRootAndroidBp(bp)),
 		)
 	})
-
-	t.Run("SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE=S", func(t *testing.T) {
-		result := android.GroupFixturePreparers(
-			prepareForSdkTestWithJava,
-			java.PrepareForTestWithJavaDefaultModules,
-			java.PrepareForTestWithJavaSdkLibraryFiles,
-			java.FixtureWithLastReleaseApis("mysdklibrary"),
-			android.FixtureWithRootAndroidBp(`
-			sdk {
-				name: "mysdk",
-				bootclasspath_fragments: ["mybootclasspathfragment"],
-			}
-
-			bootclasspath_fragment {
-				name: "mybootclasspathfragment",
-				apex_available: ["myapex"],
-				contents: ["mysdklibrary"],
-			}
-
-			java_sdk_library {
-				name: "mysdklibrary",
-				srcs: ["Test.java"],
-				compile_dex: true,
-				public: {enabled: true},
-				permitted_packages: ["mysdklibrary"],
-			}
-		`),
-			android.FixtureMergeEnv(map[string]string{
-				"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
-			}),
-		).RunTest(t)
-
-		CheckSnapshot(t, result, "mysdk", "",
-			checkUnversionedAndroidBpContents(`
-// This is auto-generated. DO NOT EDIT.
-
-prebuilt_bootclasspath_fragment {
-    name: "mybootclasspathfragment",
-    prefer: false,
-    visibility: ["//visibility:public"],
-    apex_available: ["myapex"],
-    contents: ["mysdklibrary"],
-    hidden_api: {
-        annotation_flags: "hiddenapi/annotation-flags.csv",
-        metadata: "hiddenapi/metadata.csv",
-        index: "hiddenapi/index.csv",
-        stub_flags: "hiddenapi/stub-flags.csv",
-        all_flags: "hiddenapi/all-flags.csv",
-    },
-}
-
-java_sdk_library_import {
-    name: "mysdklibrary",
-    prefer: false,
-    visibility: ["//visibility:public"],
-    apex_available: ["//apex_available:platform"],
-    shared_library: true,
-    compile_dex: true,
-    permitted_packages: ["mysdklibrary"],
-    public: {
-        jars: ["sdk_library/public/mysdklibrary-stubs.jar"],
-        stub_srcs: ["sdk_library/public/mysdklibrary_stub_sources"],
-        current_api: "sdk_library/public/mysdklibrary.txt",
-        removed_api: "sdk_library/public/mysdklibrary-removed.txt",
-        sdk_version: "current",
-    },
-}
-`),
-
-			checkAllCopyRules(`
-.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/annotation-flags.csv -> hiddenapi/annotation-flags.csv
-.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/metadata.csv -> hiddenapi/metadata.csv
-.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/index.csv -> hiddenapi/index.csv
-.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/stub-flags.csv -> hiddenapi/stub-flags.csv
-.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/all-flags.csv -> hiddenapi/all-flags.csv
-.intermediates/mysdklibrary.stubs/android_common/javac/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
-.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
-.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
-`),
-		)
-	})
-
 }
diff --git a/sdk/testing.go b/sdk/testing.go
index 294f1a5..3254cf9 100644
--- a/sdk/testing.go
+++ b/sdk/testing.go
@@ -136,7 +136,6 @@
 		androidUnversionedBpContents: sdk.GetUnversionedAndroidBpContentsForTests(),
 		androidVersionedBpContents:   sdk.GetVersionedAndroidBpContentsForTests(),
 		snapshotTestCustomizations:   map[snapshotTest]*snapshotTestCustomization{},
-		targetBuildRelease:           sdk.builderForTests.targetBuildRelease,
 	}
 
 	buildParams := sdk.BuildParamsForTests()
@@ -254,13 +253,6 @@
 	}
 	fs[filepath.Join(snapshotSubDir, "Android.bp")] = []byte(snapshotBuildInfo.androidBpContents)
 
-	// If the generated snapshot builders not for the current release then it cannot be loaded by
-	// the current release.
-	currentBuildRelease := latestBuildRelease()
-	if snapshotBuildInfo.targetBuildRelease != currentBuildRelease {
-		return
-	}
-
 	// The preparers from the original source fixture.
 	sourcePreparers := result.Preparer()
 
@@ -484,9 +476,6 @@
 	// The final output zip.
 	outputZip string
 
-	// The target build release.
-	targetBuildRelease *buildRelease
-
 	// The test specific customizations for each snapshot test.
 	snapshotTestCustomizations map[snapshotTest]*snapshotTestCustomization
 }
diff --git a/sdk/update.go b/sdk/update.go
index 389e845..3246832 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -81,19 +81,6 @@
 //     snapshot module only. The zip file containing the generated snapshot will be
 //     <sdk-name>-<number>.zip.
 //
-// SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE
-//     This allows the target build release (i.e. the release version of the build within which
-//     the snapshot will be used) of the snapshot to be specified. If unspecified then it defaults
-//     to the current build release version. Otherwise, it must be the name of one of the build
-//     releases defined in nameToBuildRelease, e.g. S, T, etc..
-//
-//     The generated snapshot must only be used in the specified target release. If the target
-//     build release is not the current build release then the generated Android.bp file not be
-//     checked for compatibility.
-//
-//     e.g. if setting SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE=S will cause the generated snapshot
-//     to be compatible with S.
-//
 
 var pctx = android.NewPackageContext("android/soong/sdk")
 
@@ -371,14 +358,6 @@
 		snapshotZipFileSuffix = "-" + version
 	}
 
-	currentBuildRelease := latestBuildRelease()
-	targetBuildReleaseEnv := config.GetenvWithDefault("SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE", currentBuildRelease.name)
-	targetBuildRelease, err := nameToRelease(targetBuildReleaseEnv)
-	if err != nil {
-		ctx.ModuleErrorf("invalid SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE: %s", err)
-		targetBuildRelease = currentBuildRelease
-	}
-
 	builder := &snapshotBuilder{
 		ctx:                   ctx,
 		sdk:                   s,
@@ -390,7 +369,6 @@
 		prebuiltModules:       make(map[string]*bpModule),
 		allMembersByName:      allMembersByName,
 		exportedMembersByName: exportedMembersByName,
-		targetBuildRelease:    targetBuildRelease,
 	}
 	s.builderForTests = builder
 
@@ -471,11 +449,7 @@
 	generateBpContents(&bp.generatedContents, bpFile)
 
 	contents := bp.content.String()
-	// If the snapshot is being generated for the current build release then check the syntax to make
-	// sure that it is compatible.
-	if targetBuildRelease == currentBuildRelease {
-		syntaxCheckSnapshotBpFile(ctx, contents)
-	}
+	syntaxCheckSnapshotBpFile(ctx, contents)
 
 	bp.build(pctx, ctx, nil)
 
@@ -1077,9 +1051,6 @@
 
 	// The set of exported members by name.
 	exportedMembersByName map[string]struct{}
-
-	// The target build release for which the snapshot is to be generated.
-	targetBuildRelease *buildRelease
 }
 
 func (s *snapshotBuilder) CopyToSnapshot(src android.Path, dest string) {
@@ -1455,16 +1426,6 @@
 	return osInfo
 }
 
-func (osInfo *osTypeSpecificInfo) pruneUnsupportedProperties(pruner *propertyPruner) {
-	if len(osInfo.archInfos) == 0 {
-		pruner.pruneProperties(osInfo.Properties)
-	} else {
-		for _, archInfo := range osInfo.archInfos {
-			archInfo.pruneUnsupportedProperties(pruner)
-		}
-	}
-}
-
 // Optimize the properties by extracting common properties from arch type specific
 // properties into os type specific properties.
 func (osInfo *osTypeSpecificInfo) optimizeProperties(ctx *memberContext, commonValueExtractor *commonValueExtractor) {
@@ -1674,16 +1635,6 @@
 	return linkType
 }
 
-func (archInfo *archTypeSpecificInfo) pruneUnsupportedProperties(pruner *propertyPruner) {
-	if len(archInfo.imageVariantInfos) == 0 {
-		pruner.pruneProperties(archInfo.Properties)
-	} else {
-		for _, imageVariantInfo := range archInfo.imageVariantInfos {
-			imageVariantInfo.pruneUnsupportedProperties(pruner)
-		}
-	}
-}
-
 // Optimize the properties by extracting common properties from link type specific
 // properties into arch type specific properties.
 func (archInfo *archTypeSpecificInfo) optimizeProperties(ctx *memberContext, commonValueExtractor *commonValueExtractor) {
@@ -1781,16 +1732,6 @@
 	return imageInfo
 }
 
-func (imageInfo *imageVariantSpecificInfo) pruneUnsupportedProperties(pruner *propertyPruner) {
-	if len(imageInfo.linkInfos) == 0 {
-		pruner.pruneProperties(imageInfo.Properties)
-	} else {
-		for _, linkInfo := range imageInfo.linkInfos {
-			linkInfo.pruneUnsupportedProperties(pruner)
-		}
-	}
-}
-
 // Optimize the properties by extracting common properties from link type specific
 // properties into arch type specific properties.
 func (imageInfo *imageVariantSpecificInfo) optimizeProperties(ctx *memberContext, commonValueExtractor *commonValueExtractor) {
@@ -1857,10 +1798,6 @@
 	addSdkMemberPropertiesToSet(ctx, l.Properties, linkPropertySet)
 }
 
-func (l *linkTypeSpecificInfo) pruneUnsupportedProperties(pruner *propertyPruner) {
-	pruner.pruneProperties(l.Properties)
-}
-
 func (l *linkTypeSpecificInfo) String() string {
 	return fmt.Sprintf("LinkType{%s}", l.linkType)
 }
@@ -1900,12 +1837,12 @@
 	memberType := member.memberType
 
 	// Do not add the prefer property if the member snapshot module is a source module type.
-	config := ctx.sdkMemberContext.Config()
 	if !memberType.UsesSourceModuleTypeInSnapshot() {
 		// Set the prefer based on the environment variable. This is a temporary work around to allow a
 		// snapshot to be created that sets prefer: true.
 		// TODO(b/174997203): Remove once the ability to select the modules to prefer can be done
 		//  dynamically at build time not at snapshot generation time.
+		config := ctx.sdkMemberContext.Config()
 		prefer := config.IsEnvTrue("SOONG_SDK_SNAPSHOT_PREFER")
 
 		// Set prefer. Setting this to false is not strictly required as that is the default but it does
@@ -1947,11 +1884,6 @@
 	commonProperties := variantPropertiesFactory()
 	commonProperties.Base().Os = android.CommonOS
 
-	// Create a property pruner that will prune any properties unsupported by the target build
-	// release.
-	targetBuildRelease := ctx.builder.targetBuildRelease
-	unsupportedPropertyPruner := newPropertyPrunerByBuildRelease(commonProperties, targetBuildRelease)
-
 	// Create common value extractor that can be used to optimize the properties.
 	commonValueExtractor := newCommonValueExtractor(commonProperties)
 
@@ -1966,8 +1898,6 @@
 		// independent properties structs.
 		osSpecificPropertiesContainers = append(osSpecificPropertiesContainers, osInfo)
 
-		osInfo.pruneUnsupportedProperties(unsupportedPropertyPruner)
-
 		// Optimize the properties across all the variants for a specific os type.
 		osInfo.optimizeProperties(ctx, commonValueExtractor)
 	}
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index afec829..3d16073 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -163,7 +163,6 @@
 	"AUX_OS_VARIANT_LIST",
 	"PRODUCT_SOONG_NAMESPACES",
 	"SOONG_SDK_SNAPSHOT_PREFER",
-	"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE",
 	"SOONG_SDK_SNAPSHOT_USE_SOURCE_CONFIG_VAR",
 	"SOONG_SDK_SNAPSHOT_VERSION",
 }