Revert "Split Java libraries per apex"

This reverts commit aa53324ac8308d974435cf2c8566835b87e3e05d.

Reason for revert: b/138337109 (broke ndk build)

Change-Id: I9497cb4337add3f8c491a684bcaadea3bdbfaa85
diff --git a/java/androidmk.go b/java/androidmk.go
index ad0e171..90fdd0f 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -55,11 +55,6 @@
 }
 
 func (library *Library) AndroidMk() android.AndroidMkData {
-	if !library.IsForPlatform() {
-		return android.AndroidMkData{
-			Disabled: true,
-		}
-	}
 	return android.AndroidMkData{
 		Class:      "JAVA_LIBRARIES",
 		OutputFile: android.OptionalPathForPath(library.outputFile),
@@ -146,11 +141,6 @@
 }
 
 func (prebuilt *Import) AndroidMk() android.AndroidMkData {
-	if !prebuilt.IsForPlatform() {
-		return android.AndroidMkData{
-			Disabled: true,
-		}
-	}
 	return android.AndroidMkData{
 		Class:      "JAVA_LIBRARIES",
 		OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile),
@@ -167,11 +157,6 @@
 }
 
 func (prebuilt *DexImport) AndroidMk() android.AndroidMkData {
-	if !prebuilt.IsForPlatform() {
-		return android.AndroidMkData{
-			Disabled: true,
-		}
-	}
 	return android.AndroidMkData{
 		Class:      "JAVA_LIBRARIES",
 		OutputFile: android.OptionalPathForPath(prebuilt.maybeStrippedDexJarFile),
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 8379f53..c83dda1 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -152,14 +152,6 @@
 		// Collect dex jar paths for modules that had hiddenapi encode called on them.
 		if h, ok := module.(hiddenAPIIntf); ok {
 			if jar := h.bootDexJar(); jar != nil {
-				// For a java lib included in an APEX, only take the one built for
-				// the platform variant, and skip the variants for APEXes.
-				// Otherwise, the hiddenapi tool will complain about duplicated classes
-				if a, ok := module.(android.ApexModule); ok {
-					if android.InAnyApex(module.Name()) && !a.IsForPlatform() {
-						return
-					}
-				}
 				bootDexJars = append(bootDexJars, jar)
 			}
 		}
diff --git a/java/java.go b/java/java.go
index ca6e232..f3e10be 100644
--- a/java/java.go
+++ b/java/java.go
@@ -267,7 +267,6 @@
 type Module struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.ApexModuleBase
 
 	properties       CompilerProperties
 	protoProperties  android.ProtoProperties
@@ -1582,7 +1581,6 @@
 		&module.Module.protoProperties)
 
 	InitJavaModule(module, android.HostAndDeviceSupported)
-	android.InitApexModule(module)
 	return module
 }
 
@@ -1605,7 +1603,6 @@
 	module.Module.properties.Installable = proptools.BoolPtr(true)
 
 	InitJavaModule(module, android.HostSupported)
-	android.InitApexModule(module)
 	return module
 }
 
@@ -1861,7 +1858,6 @@
 type Import struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.ApexModuleBase
 	prebuilt android.Prebuilt
 
 	properties ImportProperties
@@ -2018,7 +2014,6 @@
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
 	InitJavaModule(module, android.HostAndDeviceSupported)
-	android.InitApexModule(module)
 	return module
 }
 
@@ -2034,7 +2029,6 @@
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
 	InitJavaModule(module, android.HostSupported)
-	android.InitApexModule(module)
 	return module
 }
 
@@ -2047,7 +2041,6 @@
 type DexImport struct {
 	android.ModuleBase
 	android.DefaultableModuleBase
-	android.ApexModuleBase
 	prebuilt android.Prebuilt
 
 	properties DexImportProperties
@@ -2139,7 +2132,6 @@
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
 	InitJavaModule(module, android.DeviceSupported)
-	android.InitApexModule(module)
 	return module
 }
 
@@ -2149,7 +2141,6 @@
 type Defaults struct {
 	android.ModuleBase
 	android.DefaultsModuleBase
-	android.ApexModuleBase
 }
 
 // java_defaults provides a set of properties that can be inherited by other java or android modules.
@@ -2208,7 +2199,7 @@
 	)
 
 	android.InitDefaultsModule(module)
-	android.InitApexModule(module)
+
 	return module
 }