Export non-apex variants of modules to make

Currently, non-apex variants of modules that are in apexes are not
exported to make unless they're apex_available to the platform. This
means that you can't `m` those modules directly.

However, there is a workaround in the apex androidmk implementation that
emits make rules for the removed modules, but just redirects them to
build the apex itself. We want to remove that, but one of the problems
with doing so is that you can no longer `m` many modules afterwards.

To fix that, unhide the apex's dependencies from make. To ensure they're
not installed, call SkipInstall() on them, and update SkipInstall() to
be more strict by setting `LOCAL_UNINSTALLABLE_MODULE := true`.

Bug: 254205429
Test: Presubmits
Change-Id: Ib094feb2c437ad50d8319c58caa997759e7ce32f
diff --git a/cc/cc.go b/cc/cc.go
index 0e88c56..e592cc5 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -609,7 +609,6 @@
 	inSanitizerDir() bool
 	hostToolPath() android.OptionalPath
 	relativeInstallPath() string
-	makeUninstallable(mod *Module)
 	installInRoot() bool
 }
 
@@ -3535,14 +3534,6 @@
 	return c.InRecovery()
 }
 
-func (c *Module) MakeUninstallable() {
-	if c.installer == nil {
-		c.ModuleBase.MakeUninstallable()
-		return
-	}
-	c.installer.makeUninstallable(c)
-}
-
 func (c *Module) HostToolPath() android.OptionalPath {
 	if c.installer == nil {
 		return android.OptionalPath{}
diff --git a/cc/installer.go b/cc/installer.go
index e2c0e7b..c3618b7 100644
--- a/cc/installer.go
+++ b/cc/installer.go
@@ -121,10 +121,6 @@
 	return String(installer.Properties.Relative_install_path)
 }
 
-func (installer *baseInstaller) makeUninstallable(mod *Module) {
-	mod.ModuleBase.MakeUninstallable()
-}
-
 func (installer *baseInstaller) installInRoot() bool {
 	return Bool(installer.Properties.Install_in_root)
 }
diff --git a/cc/library.go b/cc/library.go
index e73af81..6891f5b 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -2424,17 +2424,6 @@
 	return nil
 }
 
-func (library *libraryDecorator) makeUninstallable(mod *Module) {
-	if library.static() && library.buildStatic() && !library.buildStubs() {
-		// If we're asked to make a static library uninstallable we don't do
-		// anything since AndroidMkEntries always sets LOCAL_UNINSTALLABLE_MODULE
-		// for these entries. This is done to still get the make targets for NOTICE
-		// files from notice_files.mk, which other libraries might depend on.
-		return
-	}
-	mod.ModuleBase.MakeUninstallable()
-}
-
 func (library *libraryDecorator) getPartition() string {
 	return library.path.Partition()
 }
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index bb517ea..9ac812c 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -214,7 +214,7 @@
 			// without the prefix hack below.
 			if p.hasStubsVariants() && !p.buildStubs() && !ctx.Host() &&
 				!strings.HasPrefix(ctx.baseModuleName(), "libclang_rt.") {
-				ctx.Module().MakeUninstallable()
+				ctx.Module().SkipInstall()
 			}
 
 			return outputFile