Convert CheckMinSdkVersion to use providers.

Next step is to convert it to use ModuleProxy once IsDepInSameApex is
converted to use providers.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I20cb052666fa95eb964e63e3302ac892d3324183
diff --git a/android/module.go b/android/module.go
index 55dd119..0ffb6cb 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1912,6 +1912,8 @@
 	SkipInstall                      bool
 	IsStubsModule                    bool
 	Host                             bool
+	MinSdkVersionSupported           ApiLevel
+	ModuleWithMinSdkVersionCheck     bool
 }
 
 type ApiLevelOrPlatform struct {
@@ -2292,7 +2294,13 @@
 		commonData.CanHaveApexVariants = am.CanHaveApexVariants()
 		commonData.NotAvailableForPlatform = am.NotAvailableForPlatform()
 		commonData.NotInPlatform = am.NotInPlatform()
+		commonData.MinSdkVersionSupported = am.MinSdkVersionSupported(ctx)
 	}
+
+	if _, ok := m.module.(ModuleWithMinSdkVersionCheck); ok {
+		commonData.ModuleWithMinSdkVersionCheck = true
+	}
+
 	if st, ok := m.module.(StubsAvailableModule); ok {
 		commonData.IsStubsModule = st.IsStubsModule()
 	}