enforce updatable apexes to set min_sdk_version

updatable APEXes should set min_sdk_version as well.

Bug: 152655956
Test: m
Merged-In: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
Change-Id: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
(cherry picked from commit 548640b55f732aa7e42ae9112d38e13e54988df2)
diff --git a/apex/apex_test.go b/apex/apex_test.go
index eed0d72..350579e 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -4017,6 +4017,7 @@
 			native_shared_libs: ["mylib"],
 			java_libs: ["myjar"],
 			updatable: true,
+			min_sdk_version: "current",
 		}
 
 		apex_key {
@@ -4242,6 +4243,22 @@
 	}
 }
 
+func TestUpdatable_should_set_min_sdk_version(t *testing.T) {
+	testApexError(t, `"myapex" .*: updatable: updatable APEXes should set min_sdk_version`, `
+		apex {
+			name: "myapex",
+			key: "myapex.key",
+			updatable: true,
+		}
+
+		apex_key {
+			name: "myapex.key",
+			public_key: "testkey.avbpubkey",
+			private_key: "testkey.pem",
+		}
+	`)
+}
+
 func TestNoUpdatableJarsInBootImage(t *testing.T) {
 	bp := `
 		java_library {