Merge "propagate min_sdk_version to java backend" am: 5a023d6399

Original change: https://android-review.googlesource.com/c/platform/system/tools/hidl/+/1567508

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I95fbafc9ce38fe7aa5188ddee2c26cca47d27007
diff --git a/build/hidl_interface.go b/build/hidl_interface.go
index c378814..788828e 100644
--- a/build/hidl_interface.go
+++ b/build/hidl_interface.go
@@ -732,9 +732,10 @@
 			// to build framework, which is used to build system_current.  Use core_current
 			// plus hwbinder.stubs, which together form a subset of system_current that does
 			// not depend on framework.
-			Sdk_version:    proptools.StringPtr("core_current"),
-			Libs:           []string{"hwbinder.stubs"},
-			Apex_available: i.properties.Apex_available,
+			Sdk_version:     proptools.StringPtr("core_current"),
+			Libs:            []string{"hwbinder.stubs"},
+			Apex_available:  i.properties.Apex_available,
+			Min_sdk_version: getMinSdkVersion(name.string()),
 		}
 
 		mctx.CreateModule(java.LibraryFactory, &javaProperties{
@@ -759,11 +760,12 @@
 			Outputs:    []string{name.sanitizedDir() + "Constants.java"},
 		})
 		mctx.CreateModule(java.LibraryFactory, &javaProperties{
-			Name:           proptools.StringPtr(name.javaConstantsName()),
-			Defaults:       []string{"hidl-java-module-defaults"},
-			Sdk_version:    proptools.StringPtr("core_current"),
-			Srcs:           []string{":" + name.javaConstantsSourcesName()},
-			Apex_available: i.properties.Apex_available,
+			Name:            proptools.StringPtr(name.javaConstantsName()),
+			Defaults:        []string{"hidl-java-module-defaults"},
+			Sdk_version:     proptools.StringPtr("core_current"),
+			Srcs:            []string{":" + name.javaConstantsSourcesName()},
+			Apex_available:  i.properties.Apex_available,
+			Min_sdk_version: getMinSdkVersion(name.string()),
 		})
 	}
 
diff --git a/build/properties.go b/build/properties.go
index 388eacd..c88bbef 100644
--- a/build/properties.go
+++ b/build/properties.go
@@ -48,15 +48,16 @@
 }
 
 type javaProperties struct {
-	Name           *string
-	Owner          *string
-	Defaults       []string
-	Installable    *bool
-	Sdk_version    *string
-	Srcs           []string
-	Libs           []string
-	Static_libs    []string
-	Apex_available []string
+	Name            *string
+	Owner           *string
+	Defaults        []string
+	Installable     *bool
+	Sdk_version     *string
+	Srcs            []string
+	Libs            []string
+	Static_libs     []string
+	Apex_available  []string
+	Min_sdk_version *string
 }
 
 type fuzzConfig struct {