Add system_ext_specific

The system_ext partition was created. So if java_sdk_library module is
installed to system_ext partition, .xml and .jar install path must be
changed to system_ext.

Bug: 143440787
Test: add system_ext_specific to java_sdk_module && make -j && check
system_ext parition

Change-Id: Ie0d0df426d4aa96ac89eb4215e7376eea3f03f54
This commit is contained in:
Sundong Ahn 2019-12-04 12:53:44 +09:00
parent f6739a65dd
commit 0d7dff48f5
1 changed files with 32 additions and 21 deletions

View File

@ -293,6 +293,8 @@ func (module *SdkLibrary) implPath() string {
partition = "odm"
} else if module.ProductSpecific() {
partition = "product"
} else if module.SystemExtSpecific() {
partition = "system_ext"
}
return "/" + partition + "/framework/" + module.implName() + ".jar"
}
@ -363,17 +365,18 @@ func (module *SdkLibrary) latestRemovedApiFilegroupName(apiScope apiScope) strin
// Creates a static java library that has API stubs
func (module *SdkLibrary) createStubsLibrary(mctx android.LoadHookContext, apiScope apiScope) {
props := struct {
Name *string
Srcs []string
Sdk_version *string
Libs []string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
Compile_dex *bool
System_modules *string
Java_version *string
Product_variables struct {
Name *string
Srcs []string
Sdk_version *string
Libs []string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
System_ext_specific *bool
Compile_dex *bool
System_modules *string
Java_version *string
Product_variables struct {
Unbundled_build struct {
Enabled *bool
}
@ -417,6 +420,8 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.LoadHookContext, apiSc
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(LibraryFactory, &props)
@ -561,12 +566,13 @@ func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) {
// creates a prebuilt_etc module to actually place the xml file under
// <partition>/etc/permissions
etcProps := struct {
Name *string
Src *string
Sub_dir *string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
Name *string
Src *string
Sub_dir *string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
System_ext_specific *bool
}{}
etcProps.Name = proptools.StringPtr(module.xmlFileName())
etcProps.Src = proptools.StringPtr(":" + module.xmlFileName() + "-gen")
@ -577,6 +583,8 @@ func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) {
etcProps.Device_specific = proptools.BoolPtr(true)
} else if module.ProductSpecific() {
etcProps.Product_specific = proptools.BoolPtr(true)
} else if module.SystemExtSpecific() {
etcProps.System_ext_specific = proptools.BoolPtr(true)
}
mctx.CreateModule(android.PrebuiltEtcFactory, &etcProps)
}
@ -795,10 +803,11 @@ func (module *sdkLibraryImport) Name() string {
func (module *sdkLibraryImport) createInternalModules(mctx android.LoadHookContext) {
// Creates a java import for the jar with ".stubs" suffix
props := struct {
Name *string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
Name *string
Soc_specific *bool
Device_specific *bool
Product_specific *bool
System_ext_specific *bool
}{}
props.Name = proptools.StringPtr(module.BaseModuleName() + sdkStubsLibrarySuffix)
@ -809,6 +818,8 @@ func (module *sdkLibraryImport) createInternalModules(mctx android.LoadHookConte
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(ImportFactory, &props, &module.properties)