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

Commit 77aafce4 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add system server jars expressed in make in the system server...

Merge "Add system server jars expressed in make in the system server classpath." am: cbeaab29 am: dfb95250

Change-Id: If051c37e9ff734907307ee2a365bef4a17f8cec8
parents a56edc6e dfb95250
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
package java

import (
	"fmt"
	"path/filepath"
	"strings"

@@ -29,14 +30,29 @@ func systemServerClasspath(ctx android.MakeVarsContext) []string {
	return ctx.Config().OnceStringSlice(systemServerClasspathKey, func() []string {
		global := dexpreopt.GetGlobalConfig(ctx)
		var systemServerClasspathLocations []string
		for _, m := range *DexpreoptedSystemServerJars(ctx.Config()) {
		var dexpreoptJars = *DexpreoptedSystemServerJars(ctx.Config())
		// 1) The jars that are dexpreopted.
		for _, m := range dexpreoptJars {
			systemServerClasspathLocations = append(systemServerClasspathLocations,
				filepath.Join("/system/framework", m+".jar"))
		}
		// 2) The jars that are from an updatable apex.
		for _, m := range global.UpdatableSystemServerJars {
			systemServerClasspathLocations = append(systemServerClasspathLocations,
				dexpreopt.GetJarLocationFromApexJarPair(m))
		}
		// 3) The jars from make (which are not updatable, not preopted).
		for _, m := range dexpreopt.NonUpdatableSystemServerJars(ctx, global) {
			if !android.InList(m, dexpreoptJars) {
				systemServerClasspathLocations = append(systemServerClasspathLocations,
					filepath.Join("/system/framework", m+".jar"))
			}
		}
		if len(systemServerClasspathLocations) != len(global.SystemServerJars)+len(global.UpdatableSystemServerJars) {
			panic(fmt.Errorf("Wrong number of system server jars, got %d, expected %d",
				len(systemServerClasspathLocations),
				len(global.SystemServerJars)+len(global.UpdatableSystemServerJars)))
		}
		return systemServerClasspathLocations
	})
}