Mandate #apex or #systemapi tag for the Mainline APIs
Currently, tagging a symbol with #apex is not required when the symbol is in a non-NDK library. However, this is considered dangerous because such a symbol will automatically be promoted to NDK APIs when the library is promoted to an NDK library. When that happens, the native API council won't be able to notice the promotion because promoting a non-NDK library into an NDK library doesn't require an update of the map.txt file, but Android.bp only. To prevent that, we should mandate #apex (or #systemapi if the api is provided by the system, not apex) tag for Mainline APIs regardless of whether the library the API belongs to is an NDK library or not. Bug: 184712170 Test: m Change-Id: Iad589b606bc6ed06ef1237f4c9f0c22518b0db75
This commit is contained in:
@@ -1089,6 +1089,12 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
|
||||
} else {
|
||||
flag = "--systemapi"
|
||||
}
|
||||
// b/184712170, unless the lib is an NDK library, exclude all public symbols from
|
||||
// the stub so that it is mandated that all symbols are explicitly marked with
|
||||
// either apex or systemapi.
|
||||
if !ctx.Module().(*Module).IsNdk(ctx.Config()) {
|
||||
flag = flag + " --no-ndk"
|
||||
}
|
||||
nativeAbiResult := parseNativeAbiDefinition(ctx, symbolFile,
|
||||
android.ApiLevelOrPanic(ctx, library.MutatedProperties.StubsVersion), flag)
|
||||
objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc)
|
||||
|
Reference in New Issue
Block a user