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

Commit 1f9e90a3 authored by David Brazdil's avatar David Brazdil Committed by Gerrit Code Review
Browse files

Merge "Set usesNonSdkApi in manifest when Platform_apis=true"

parents dd739bbd d25060aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ type aapt struct {
	isLibrary             bool
	uncompressedJNI       bool
	useEmbeddedDex        bool
	usesNonSdkApis        bool

	aaptProperties aaptProperties
}
@@ -184,7 +185,7 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex
	manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)

	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)

+5 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ var manifestMergerRule = pctx.AndroidStaticRule("manifestMerger",
	"libs")

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
	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 {
		args = append(args, "--use-embedded-dex=true")
	}
+2 −0
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ func (a *AndroidApp) shouldUncompressDex(ctx android.ModuleContext) bool {
}

func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) {
	a.aapt.usesNonSdkApis = Bool(a.Module.deviceProperties.Platform_apis)

	aaptLinkFlags := []string{}

	// Add TARGET_AAPT_CHARACTERISTICS values to AAPT link flags if they exist and --product flags were not provided.