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

Commit 80850d86 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix the ABI dump directory name for vendor libraries"

parents 067e62e4 a90bd389
Loading
Loading
Loading
Loading
+18 −19
Original line number Diff line number Diff line
@@ -1875,25 +1875,21 @@ func prevDumpRefVersion(ctx ModuleContext) int {
	}
}

func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
	if library.sabi.shouldCreateSourceAbiDump() {
		var version string
		var prevVersion int

		if ctx.useVndk() {
			// For modules linking against vndk, follow its vndk version
			version = ctx.Module().(*Module).VndkVersion()
		} else {
			// After sdk finalizatoin, the ABI of the latest API level must be consistent with the source code
			// so the chosen reference dump is the PLATFORM_SDK_VERSION.
			if ctx.Config().PlatformSdkFinal() {
				version = ctx.Config().PlatformSdkVersion().String()
func currRefAbiDumpVersion(ctx ModuleContext, isVndk bool) string {
	if isVndk {
		// Each version of VNDK is independent, so follow the VNDK version which is the codename or PLATFORM_SDK_VERSION.
		return ctx.Module().(*Module).VndkVersion()
	} else if ctx.Config().PlatformSdkFinal() {
		// After sdk finalization, the ABI of the latest API level must be consistent with the source code,
		// so choose PLATFORM_SDK_VERSION as the current version.
		return ctx.Config().PlatformSdkVersion().String()
	} else {
				version = "current"
		return "current"
	}
			prevVersion = prevDumpRefVersion(ctx)
}

func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
	if library.sabi.shouldCreateSourceAbiDump() {
		exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
		var SourceAbiFlags []string
		for _, dir := range exportIncludeDirs.Strings() {
@@ -1910,10 +1906,12 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec

		addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String())

		isVndk := ctx.useVndk() && ctx.isVndk()
		isNdk := ctx.isNdk(ctx.Config())
		isLlndk := ctx.isImplementationForLLNDKPublic()
		// If NDK or PLATFORM library, check against previous version ABI.
		if !ctx.useVndk() {
		if !isVndk {
			prevVersion := prevDumpRefVersion(ctx)
			prevRefAbiDumpFile := getRefAbiDumpFile(ctx, strconv.Itoa(prevVersion), fileName)
			if prevRefAbiDumpFile != nil {
				library.prevSAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
@@ -1924,7 +1922,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
			}
		}

		refAbiDumpFile := getRefAbiDumpFile(ctx, version, fileName)
		currVersion := currRefAbiDumpVersion(ctx, isVndk)
		refAbiDumpFile := getRefAbiDumpFile(ctx, currVersion, fileName)
		if refAbiDumpFile != nil {
			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
				refAbiDumpFile, fileName,