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

Commit 42da69d7 authored by Paul Duffin's avatar Paul Duffin
Browse files

Add preparer for overlay pre-singleton registration

It appears as though this is the first pre-singleton type to actually
be registered with the InitRegistrationContext as it failed due to an
uninitialized map, so this change also fixes that.

Bug: 182885307
Test: m nothing
Change-Id: Ibbf6d0db5f3c2fcc89291a16aa5f16b8b5009bd3
parent 97d8b40f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ type RegistrationContext interface {
var InitRegistrationContext RegistrationContext = &initRegistrationContext{
	moduleTypes:       make(map[string]ModuleFactory),
	singletonTypes:    make(map[string]SingletonFactory),
	preSingletonTypes: make(map[string]SingletonFactory),
}

// Make sure the TestContext implements RegistrationContext.
+4 −1
Original line number Diff line number Diff line
@@ -22,8 +22,11 @@ import (
)

func init() {
	android.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
	registerOverlayBuildComponents(android.InitRegistrationContext)
}

func registerOverlayBuildComponents(ctx android.RegistrationContext) {
	ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
}

var androidResourceIgnoreFilenames = []string{
+1 −1
Original line number Diff line number Diff line
@@ -71,11 +71,11 @@ var prepareForJavaTest = android.GroupFixturePreparers(
	cc.PrepareForTestWithCcBuildComponents,
	// Include all the default java modules.
	PrepareForTestWithJavaDefaultModules,
	PrepareForTestWithOverlayBuildComponents,
	python.PrepareForTestWithPythonBuildComponents,
	android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
		ctx.RegisterModuleType("java_plugin", PluginFactory)

		ctx.RegisterPreSingletonType("overlay", OverlaySingletonFactory)
		ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory)
	}),
	dexpreopt.PrepareForTestWithDexpreopt,
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ var PrepareForTestWithJavaDefaultModules = android.GroupFixturePreparers(
	android.FixtureAddTextFile(defaultJavaDir+"/Android.bp", GatherRequiredDepsForTest()),
)

var PrepareForTestWithOverlayBuildComponents = android.FixtureRegisterWithContext(registerOverlayBuildComponents)

// Prepare a fixture to use all java module types, mutators and singletons fully.
//
// This should only be used by tests that want to run with as much of the build enabled as possible.