Refactor for preliminary Rust vendor image support

Refactors parts of CC to prepare for preliminary support for using Rust
static libraries in vendor images. Some previously private functions are
made public, and additional functions are added to LinkableInterface so
GetMakeLinkType can be passed a LinkableInterface.

Bug: 172525289
Test: m
Change-Id: I5fda48e79532fe9ceab255e18d910af58048a123
diff --git a/cc/library.go b/cc/library.go
index c626b03..00bb4bc 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -575,13 +575,13 @@
 	}
 	if ctx.useVndk() && ctx.isVndk() && !ctx.isVndkPrivate(ctx.Config()) {
 		if ctx.isVndkSp() {
-			if ctx.isVndkExt() {
+			if ctx.IsVndkExt() {
 				return "VNDK-SP-ext"
 			} else {
 				return "VNDK-SP"
 			}
 		} else {
-			if ctx.isVndkExt() {
+			if ctx.IsVndkExt() {
 				return "VNDK-ext"
 			} else {
 				return "VNDK-core"
@@ -730,7 +730,7 @@
 func (library *libraryDecorator) getLibName(ctx BaseModuleContext) string {
 	name := library.getLibNameHelper(ctx.baseModuleName(), ctx.useVndk())
 
-	if ctx.isVndkExt() {
+	if ctx.IsVndkExt() {
 		// vndk-ext lib should have the same name with original lib
 		ctx.VisitDirectDepsWithTag(vndkExtDepTag, func(module android.Module) {
 			originalName := module.(*Module).outputFile.Path()
@@ -1153,7 +1153,7 @@
 			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
 				refAbiDumpFile, fileName, exportedHeaderFlags,
 				Bool(library.Properties.Header_abi_checker.Check_all_apis),
-				ctx.isLlndk(ctx.Config()), ctx.isNdk(ctx.Config()), ctx.isVndkExt())
+				ctx.isLlndk(ctx.Config()), ctx.isNdk(ctx.Config()), ctx.IsVndkExt())
 		}
 	}
 }
@@ -1269,7 +1269,7 @@
 	if library.shared() {
 		if ctx.Device() && ctx.useVndk() {
 			// set subDir for VNDK extensions
-			if ctx.isVndkExt() {
+			if ctx.IsVndkExt() {
 				if ctx.isVndkSp() {
 					library.baseInstaller.subDir = "vndk-sp"
 				} else {
@@ -1278,7 +1278,7 @@
 			}
 
 			// In some cases we want to use core variant for VNDK-Core libs
-			if ctx.isVndk() && !ctx.isVndkSp() && !ctx.isVndkExt() {
+			if ctx.isVndk() && !ctx.isVndkSp() && !ctx.IsVndkExt() {
 				mayUseCoreVariant := true
 
 				if ctx.mustUseVendorVariant() {
@@ -1299,7 +1299,7 @@
 
 			// do not install vndk libs
 			// vndk libs are packaged into VNDK APEX
-			if ctx.isVndk() && !ctx.isVndkExt() {
+			if ctx.isVndk() && !ctx.IsVndkExt() {
 				return
 			}
 		} else if len(library.Properties.Stubs.Versions) > 0 && !ctx.Host() && ctx.directlyInAnyApex() {