Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b52adbcd authored by Harshit Mahajan's avatar Harshit Mahajan
Browse files

Add combined_api_defaults module type

Allow specifying default combined api properties. This would be currently used to control the enablement of new mainline modules

Bug:b/289203818
Test: verified locally
Change-Id: I9415140453ce04efd5461cb8684c70e987810ecc
parent 2ab8f35e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ type CombinedApisProperties struct {

type CombinedApis struct {
	android.ModuleBase
	android.DefaultableModuleBase

	properties CombinedApisProperties
}
@@ -74,6 +75,7 @@ func init() {

func registerBuildComponents(ctx android.RegistrationContext) {
	ctx.RegisterModuleType("combined_apis", combinedApisModuleFactory)
	ctx.RegisterModuleType("combined_apis_defaults", CombinedApisModuleDefaultsFactory)
}

var PrepareForCombinedApisTest = android.FixtureRegisterWithContext(registerBuildComponents)
@@ -409,6 +411,7 @@ func combinedApisModuleFactory() android.Module {
	module := &CombinedApis{}
	module.AddProperties(&module.properties)
	android.InitAndroidModule(module)
	android.InitDefaultableModule(module)
	android.AddLoadHook(module, func(ctx android.LoadHookContext) { module.createInternalModules(ctx) })
	return module
}
@@ -445,3 +448,16 @@ func remove(s []string, v string) []string {
	}
	return s2
}

// Defaults
type CombinedApisModuleDefaults struct {
	android.ModuleBase
	android.DefaultsModuleBase
}

func CombinedApisModuleDefaultsFactory() android.Module {
	module := &CombinedApisModuleDefaults{}
	module.AddProperties(&CombinedApisProperties{})
	android.InitDefaultsModule(module)
	return module
}