Merge "Pass module-lib and system-server extension jars for system-server" into main am: 7a4d748669
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3072144 Change-Id: I596139c5cdd1e118dc99c4bfc9b40ca0feb97a0d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -626,7 +626,8 @@ func (d *Droidstubs) apiLevelsGenerationFlags(ctx android.ModuleContext, cmd *an
|
||||
// privileged apps that are only defined since API level 21 (Lollipop), fallback to public stubs
|
||||
// for older releases. Similarly, module-lib falls back to system API.
|
||||
var sdkDirs []string
|
||||
switch proptools.StringDefault(d.properties.Api_levels_sdk_type, "public") {
|
||||
apiLevelsSdkType := proptools.StringDefault(d.properties.Api_levels_sdk_type, "public")
|
||||
switch apiLevelsSdkType {
|
||||
case "system-server":
|
||||
sdkDirs = []string{"system-server", "module-lib", "system", "public"}
|
||||
case "module-lib":
|
||||
@@ -640,9 +641,22 @@ func (d *Droidstubs) apiLevelsGenerationFlags(ctx android.ModuleContext, cmd *an
|
||||
return
|
||||
}
|
||||
|
||||
// Construct a pattern to match the appropriate extensions that should be included in the
|
||||
// generated api-versions.xml file.
|
||||
//
|
||||
// Use the first item in the sdkDirs array as that is the sdk type for the target API levels
|
||||
// being generated but has the advantage over `Api_levels_sdk_type` as it has been validated.
|
||||
extensionsPattern := fmt.Sprintf(`/extensions/[0-9]+/%s/.*\.jar`, sdkDirs[0])
|
||||
// The exception is for system-server which needs to include module-lib and system-server. That
|
||||
// is because while system-server extends module-lib the system-server extension directory only
|
||||
// contains service-* modules which provide system-server APIs it does not list the modules which
|
||||
// only provide a module-lib, so they have to be included separately.
|
||||
extensionSurfacesPattern := sdkDirs[0]
|
||||
if apiLevelsSdkType == "system-server" {
|
||||
// Take the first two items in sdkDirs, which are system-server and module-lib, and construct
|
||||
// a pattern that will match either.
|
||||
extensionSurfacesPattern = strings.Join(sdkDirs[0:2], "|")
|
||||
}
|
||||
extensionsPattern := fmt.Sprintf(`/extensions/[0-9]+/(%s)/.*\.jar`, extensionSurfacesPattern)
|
||||
|
||||
var dirs []string
|
||||
var extensions_dir string
|
||||
|
Reference in New Issue
Block a user