Prevent statically linking to a lib providing stable C APIs

A lib providing stable C APIs should be available only to the APEX
containing the library. It shouldn't be available to other APEXes,
especially via static linking.

This change also fixes a bug that llndkImplDep (the dependency from
llndk stub to its implementation library) was recognized as being in the
same APEX.

Bug: 151051671
Test: m
Change-Id: Ifda7f4a367f68afcde93c86cda45a28cacd91f99
This commit is contained in:
Jiyong Park
2020-03-11 16:03:09 +09:00
parent 1c7e962957
commit 45b90e79c9
3 changed files with 78 additions and 0 deletions

View File

@@ -2851,6 +2851,9 @@ func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
return false
}
}
} else if ctx.OtherModuleDependencyTag(dep) == llndkImplDep {
// We don't track beyond LLNDK
return false
}
return true
}