Cleanup java.DefaultsFactory()

This function took a props varargs parameter but it was only ever
called with no parameters. The props parameter meant it could not be
used directly with RegisterModuleType() so the defaultsFactory() func
was added which simply called through to DefaultsFactory().

Removing the props varargs parameter allowed it to be used directly
with RegisterModuleType() and so the defaultsFactory() could be
removed.

This was needed because a follow up change adds a test in another
package that uses java_defaults and so it needs the factory method
(defaultsFactory()) to be exported.

Test: m nothing
Change-Id: I33d5c4d4ce8f349b1e6fc706d5e9656faf303b4f
This commit is contained in:
Paul Duffin
2019-12-05 14:07:14 +00:00
parent a0dbf43a82
commit 4735766ef8
2 changed files with 3 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ import (
)
func init() {
android.RegisterModuleType("java_defaults", defaultsFactory)
android.RegisterModuleType("java_defaults", DefaultsFactory)
android.RegisterModuleType("java_library", LibraryFactory)
android.RegisterModuleType("java_library_static", LibraryStaticFactory)
@@ -2452,10 +2452,9 @@ func defaultsFactory() android.Module {
return DefaultsFactory()
}
func DefaultsFactory(props ...interface{}) android.Module {
func DefaultsFactory() android.Module {
module := &Defaults{}
module.AddProperties(props...)
module.AddProperties(
&CompilerProperties{},
&CompilerDeviceProperties{},