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

Commit c01a5cd7 authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Only get dexpreopt config for device modules"

parents 3d221b30 38310bb4
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -122,29 +122,33 @@ func moduleName(ctx android.BaseModuleContext) string {
}

func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
	global := dexpreopt.GetGlobalConfig(ctx)
	if !ctx.Device() {
		return true
	}

	if global.DisablePreopt {
	if d.isTest {
		return true
	}

	if inList(moduleName(ctx), global.DisablePreoptModules) {
	if !BoolDefault(d.dexpreoptProperties.Dex_preopt.Enabled, true) {
		return true
	}

	if d.isTest {
	if !ctx.Module().(DexpreopterInterface).IsInstallable() {
		return true
	}

	if !BoolDefault(d.dexpreoptProperties.Dex_preopt.Enabled, true) {
	if !android.IsModulePreferred(ctx.Module()) {
		return true
	}

	if !ctx.Module().(DexpreopterInterface).IsInstallable() {
	global := dexpreopt.GetGlobalConfig(ctx)

	if global.DisablePreopt {
		return true
	}

	if ctx.Host() {
	if inList(moduleName(ctx), global.DisablePreoptModules) {
		return true
	}

@@ -161,10 +165,6 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
		}
	}

	if !android.IsModulePreferred(ctx.Module()) {
		return true
	}

	// TODO: contains no java code

	return false