Make more java modules defaultable

Make java_import, android_library and android_library_import modules
defaultable, and add some missing property structs to java_defaults.
Also use InitJavaModule everywhere.

Test: m checkbuild
Change-Id: I981875bbec5d1f87bae73f36a385e0b77c56c368
diff --git a/java/aar.go b/java/aar.go
index 29f5597..35fb96f 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -359,7 +359,7 @@
 
 	module.androidLibraryProperties.BuildAAR = true
 
-	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
+	InitJavaModule(module, android.DeviceSupported)
 	return module
 }
 
@@ -382,6 +382,7 @@
 
 type AARImport struct {
 	android.ModuleBase
+	android.DefaultableModuleBase
 	prebuilt android.Prebuilt
 
 	properties AARImportProperties
@@ -555,6 +556,6 @@
 	module.AddProperties(&module.properties)
 
 	android.InitPrebuiltModule(module, &module.properties.Aars)
-	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
+	InitJavaModule(module, android.DeviceSupported)
 	return module
 }
diff --git a/java/java.go b/java/java.go
index 8b354d9..b4b8feb 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1493,7 +1493,6 @@
 	module.Module.properties.Installable = proptools.BoolPtr(true)
 
 	InitJavaModule(module, android.HostAndDeviceSupported)
-	android.InitDefaultableModule(module)
 	return module
 }
 
@@ -1508,7 +1507,6 @@
 	module.Module.properties.Installable = proptools.BoolPtr(true)
 
 	InitJavaModule(module, android.HostSupported)
-	android.InitDefaultableModule(module)
 	return module
 }
 
@@ -1624,6 +1622,7 @@
 
 type Import struct {
 	android.ModuleBase
+	android.DefaultableModuleBase
 	prebuilt android.Prebuilt
 
 	properties ImportProperties
@@ -1752,7 +1751,7 @@
 	module.AddProperties(&module.properties)
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
-	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)
+	InitJavaModule(module, android.HostAndDeviceSupported)
 	return module
 }
 
@@ -1762,7 +1761,7 @@
 	module.AddProperties(&module.properties)
 
 	android.InitPrebuiltModule(module, &module.properties.Jars)
-	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
+	InitJavaModule(module, android.HostSupported)
 	return module
 }
 
@@ -1792,6 +1791,13 @@
 		&CompilerProperties{},
 		&CompilerDeviceProperties{},
 		&android.ProtoProperties{},
+		&aaptProperties{},
+		&androidLibraryProperties{},
+		&appProperties{},
+		&appTestProperties{},
+		&ImportProperties{},
+		&AARImportProperties{},
+		&sdkLibraryProperties{},
 	)
 
 	android.InitDefaultsModule(module)
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 3e6908b..a8c3b11 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -691,7 +691,6 @@
 	module := &sdkLibrary{}
 	module.AddProperties(&module.properties)
 	module.AddProperties(&module.deviceProperties)
-	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
-	android.InitDefaultableModule(module)
+	InitJavaModule(module, android.DeviceSupported)
 	return module
 }