Apex: add NeverAllowRule for updatable

to enforce that apexes that set updatable: true also set min_sdk_version

Bug: 152655956
Test: m
Change-Id: I0d2e9f9b3234873de073ab82d91211faedd16498
This commit is contained in:
Jooyung Han
2020-04-08 14:13:04 +09:00
parent ee42b2079d
commit e17caa63a6

View File

@@ -1005,6 +1005,12 @@ func makeApexAvailableWhitelist() map[string][]string {
} }
func init() { func init() {
android.AddNeverAllowRules(android.NeverAllow().
ModuleType("apex").
With("updatable", "true").
With("min_sdk_version", "").
Because("All updatable apexes should set min_sdk_version."))
android.RegisterModuleType("apex", BundleFactory) android.RegisterModuleType("apex", BundleFactory)
android.RegisterModuleType("apex_test", testApexBundleFactory) android.RegisterModuleType("apex_test", testApexBundleFactory)
android.RegisterModuleType("apex_vndk", vndkApexBundleFactory) android.RegisterModuleType("apex_vndk", vndkApexBundleFactory)