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

Commit 1dbe3ca2 authored by Paul Duffin's avatar Paul Duffin
Browse files

Remove unnecessary copying of common properties

The (Soc/Device/Product/System_ext)_specific are all properties in
ModuleBase.commonProperties. Initially, they were explicitly copied
from the parent to the child. Since then the CreateModule() method
was modified to automatically copy all the commonProperties from the
parent to the child so this code is no longer necessary.

Bug: 156618935
Test: m nothing
      checked that it does not change the generated xml permissions
	  file for a java_sdk_library that sets soc_specific: true and
	  is in the vendor partition.
Change-Id: I8c985b50cb6b6c019b33a4652de482ded689fee4
parent e070b8eb
Loading
Loading
Loading
Loading
+20 −59
Original line number Diff line number Diff line
@@ -755,10 +755,6 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.DefaultableHookContext
		System_modules    *string
		Patch_module      *string
		Libs              []string
		Soc_specific        *bool
		Device_specific     *bool
		Product_specific    *bool
		System_ext_specific *bool
		Compile_dex       *bool
		Java_version      *string
		Product_variables struct {
@@ -801,15 +797,6 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.DefaultableHookContext
		props.Compile_dex = module.Library.Module.deviceProperties.Compile_dex
	}

	if module.SocSpecific() {
		props.Soc_specific = proptools.BoolPtr(true)
	} else if module.DeviceSpecific() {
		props.Device_specific = proptools.BoolPtr(true)
	} else if module.ProductSpecific() {
		props.Product_specific = proptools.BoolPtr(true)
	} else if module.SystemExtSpecific() {
		props.System_ext_specific = proptools.BoolPtr(true)
	}
	// Dist the class jar artifact for sdk builds.
	if !Bool(module.sdkLibraryProperties.No_dist) {
		props.Dist.Targets = []string{"sdk", "win_sdk"}
@@ -986,10 +973,6 @@ func (module *SdkLibrary) createXmlFile(mctx android.DefaultableHookContext) {
	props := struct {
		Name           *string
		Lib_name       *string
		Soc_specific        *bool
		Device_specific     *bool
		Product_specific    *bool
		System_ext_specific *bool
		Apex_available []string
	}{
		Name:           proptools.StringPtr(module.xmlFileName()),
@@ -997,16 +980,6 @@ func (module *SdkLibrary) createXmlFile(mctx android.DefaultableHookContext) {
		Apex_available: module.ApexProperties.Apex_available,
	}

	if module.SocSpecific() {
		props.Soc_specific = proptools.BoolPtr(true)
	} else if module.DeviceSpecific() {
		props.Device_specific = proptools.BoolPtr(true)
	} else if module.ProductSpecific() {
		props.Product_specific = proptools.BoolPtr(true)
	} else if module.SystemExtSpecific() {
		props.System_ext_specific = proptools.BoolPtr(true)
	}

	mctx.CreateModule(sdkLibraryXmlFactory, &props)
}

@@ -1428,10 +1401,6 @@ func (module *sdkLibraryImport) createJavaImportForStubs(mctx android.Defaultabl
	// Creates a java import for the jar with ".stubs" suffix
	props := struct {
		Name        *string
		Soc_specific        *bool
		Device_specific     *bool
		Product_specific    *bool
		System_ext_specific *bool
		Sdk_version *string
		Libs        []string
		Jars        []string
@@ -1443,15 +1412,7 @@ func (module *sdkLibraryImport) createJavaImportForStubs(mctx android.Defaultabl
	// scopes to avoid having to duplicate them in each scope.
	props.Libs = append(module.properties.Libs, scopeProperties.Libs...)
	props.Jars = scopeProperties.Jars
	if module.SocSpecific() {
		props.Soc_specific = proptools.BoolPtr(true)
	} else if module.DeviceSpecific() {
		props.Device_specific = proptools.BoolPtr(true)
	} else if module.ProductSpecific() {
		props.Product_specific = proptools.BoolPtr(true)
	} else if module.SystemExtSpecific() {
		props.System_ext_specific = proptools.BoolPtr(true)
	}

	// The imports are preferred if the java_sdk_library_import is preferred.
	props.Prefer = proptools.BoolPtr(module.prebuilt.Prefer())
	mctx.CreateModule(ImportFactory, &props)