Merge "Set usesNonSdkApi in manifest when Platform_apis=true"
This commit is contained in:
@@ -77,6 +77,7 @@ type aapt struct {
|
|||||||
isLibrary bool
|
isLibrary bool
|
||||||
uncompressedJNI bool
|
uncompressedJNI bool
|
||||||
useEmbeddedDex bool
|
useEmbeddedDex bool
|
||||||
|
usesNonSdkApis bool
|
||||||
|
|
||||||
aaptProperties aaptProperties
|
aaptProperties aaptProperties
|
||||||
}
|
}
|
||||||
@@ -184,7 +185,7 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex
|
|||||||
manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
|
manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
|
||||||
|
|
||||||
manifestPath := manifestMerger(ctx, manifestSrcPath, sdkContext, staticLibManifests, a.isLibrary,
|
manifestPath := manifestMerger(ctx, manifestSrcPath, sdkContext, staticLibManifests, a.isLibrary,
|
||||||
a.uncompressedJNI, a.useEmbeddedDex)
|
a.uncompressedJNI, a.useEmbeddedDex, a.usesNonSdkApis)
|
||||||
|
|
||||||
linkFlags, linkDeps, resDirs, overlayDirs, rroDirs := a.aapt2Flags(ctx, sdkContext, manifestPath)
|
linkFlags, linkDeps, resDirs, overlayDirs, rroDirs := a.aapt2Flags(ctx, sdkContext, manifestPath)
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ var manifestMergerRule = pctx.AndroidStaticRule("manifestMerger",
|
|||||||
"libs")
|
"libs")
|
||||||
|
|
||||||
func manifestMerger(ctx android.ModuleContext, manifest android.Path, sdkContext sdkContext,
|
func manifestMerger(ctx android.ModuleContext, manifest android.Path, sdkContext sdkContext,
|
||||||
staticLibManifests android.Paths, isLibrary bool, uncompressedJNI, useEmbeddedDex bool) android.Path {
|
staticLibManifests android.Paths, isLibrary, uncompressedJNI, useEmbeddedDex, usesNonSdkApis bool) android.Path {
|
||||||
|
|
||||||
var args []string
|
var args []string
|
||||||
if isLibrary {
|
if isLibrary {
|
||||||
@@ -62,6 +62,10 @@ func manifestMerger(ctx android.ModuleContext, manifest android.Path, sdkContext
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if usesNonSdkApis {
|
||||||
|
args = append(args, "--uses-non-sdk-api")
|
||||||
|
}
|
||||||
|
|
||||||
if useEmbeddedDex {
|
if useEmbeddedDex {
|
||||||
args = append(args, "--use-embedded-dex=true")
|
args = append(args, "--use-embedded-dex=true")
|
||||||
}
|
}
|
||||||
|
@@ -186,6 +186,8 @@ func (a *AndroidApp) shouldUncompressDex(ctx android.ModuleContext) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) {
|
func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) {
|
||||||
|
a.aapt.usesNonSdkApis = Bool(a.Module.deviceProperties.Platform_apis)
|
||||||
|
|
||||||
aaptLinkFlags := []string{}
|
aaptLinkFlags := []string{}
|
||||||
|
|
||||||
// Add TARGET_AAPT_CHARACTERISTICS values to AAPT link flags if they exist and --product flags were not provided.
|
// Add TARGET_AAPT_CHARACTERISTICS values to AAPT link flags if they exist and --product flags were not provided.
|
||||||
|
Reference in New Issue
Block a user