Add min_sdk_version when generating cc modules am: dc1bce898e

Change-Id: Idfe6490d9bfa44317c3f4d3bc3709434885b8c91
diff --git a/build/hidl_interface.go b/build/hidl_interface.go
index 865d2d3..71f4a68 100644
--- a/build/hidl_interface.go
+++ b/build/hidl_interface.go
@@ -655,6 +655,7 @@
 			}),
 			Export_generated_headers: []string{name.headersName()},
 			Apex_available:           i.properties.Apex_available,
+			Min_sdk_version:          getMinSdkVersion(name.string()),
 		}, &i.properties.VndkProperties)
 	}
 
@@ -935,6 +936,37 @@
 	return i
 }
 
+var minSdkVersion = map[string]string{
+	"android.hardware.cas.native@1.0":           "29",
+	"android.hardware.cas@1.0":                  "29",
+	"android.hardware.graphics.allocator@2.0":   "29",
+	"android.hardware.graphics.allocator@3.0":   "29",
+	"android.hardware.graphics.bufferqueue@1.0": "29",
+	"android.hardware.graphics.bufferqueue@2.0": "29",
+	"android.hardware.graphics.common@1.0":      "29",
+	"android.hardware.graphics.common@1.1":      "29",
+	"android.hardware.graphics.common@1.2":      "29",
+	"android.hardware.graphics.mapper@2.0":      "29",
+	"android.hardware.graphics.mapper@2.1":      "29",
+	"android.hardware.graphics.mapper@3.0":      "29",
+	"android.hardware.media.bufferpool@2.0":     "29",
+	"android.hardware.media.c2@1.0":             "29",
+	"android.hardware.media.omx@1.0":            "29",
+	"android.hardware.media@1.0":                "29",
+	"android.hidl.allocator@1.0":                "29",
+	"android.hidl.memory.token@1.0":             "29",
+	"android.hidl.memory@1.0":                   "29",
+	"android.hidl.safe_union@1.0":               "29",
+	"android.hidl.token@1.0":                    "29",
+}
+
+func getMinSdkVersion(name string) *string {
+	if ver, ok := minSdkVersion[name]; ok {
+		return proptools.StringPtr(ver)
+	}
+	return nil
+}
+
 var doubleLoadablePackageNames = []string{
 	"android.frameworks.bufferhub@1.0",
 	"android.hardware.cas@1.0",
diff --git a/build/properties.go b/build/properties.go
index e945515..b0b4b85 100644
--- a/build/properties.go
+++ b/build/properties.go
@@ -42,6 +42,7 @@
 	Double_loadable           *bool
 	Cflags                    []string
 	Apex_available            []string
+	Min_sdk_version           *string
 }
 
 type javaProperties struct {