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

Commit 80a4e453 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Disable source map id usage in eng builds" into main

parents 3d817e8c 91d0beea
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ func (d *dexer) d8Flags(ctx android.ModuleContext, dexParams *compileDexParams)
	return d8Flags, d8Deps, artProfileOutput
}

func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams) (r8Flags []string, r8Deps android.Paths, artProfileOutput *android.OutputPath) {
func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams, debugMode bool) (r8Flags []string, r8Deps android.Paths, artProfileOutput *android.OutputPath) {
	flags := dexParams.flags
	opt := d.dexProperties.Optimize

@@ -363,7 +363,9 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams)
		r8Flags = append(r8Flags, "--force-proguard-compatibility")
	}

	if Bool(opt.Optimize) || Bool(opt.Obfuscate) {
	// Avoid unnecessary stack frame noise by only injecting source map ids for non-debug
	// optimized or obfuscated targets.
	if (Bool(opt.Optimize) || Bool(opt.Obfuscate)) && !debugMode {
		// TODO(b/213833843): Allow configuration of the prefix via a build variable.
		var sourceFilePrefix = "go/retraceme "
		var sourceFileTemplate = "\"" + sourceFilePrefix + "%MAP_ID\""
@@ -483,7 +485,8 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
			proguardUsageZip,
			proguardConfiguration,
		}
		r8Flags, r8Deps, r8ArtProfileOutputPath := d.r8Flags(ctx, dexParams)
		debugMode := android.InList("--debug", commonFlags)
		r8Flags, r8Deps, r8ArtProfileOutputPath := d.r8Flags(ctx, dexParams, debugMode)
		rule := r8
		args := map[string]string{
			"r8Flags":        strings.Join(append(commonFlags, r8Flags...), " "),