Add hidden_api for java_import

Test: go java tests
Test: m
Bug: 160455085
Change-Id: Ib6e826e32ca73ceea0799b26145ad06b1e62a1bf
diff --git a/android/module.go b/android/module.go
index 046c0a0..5192a6a 100644
--- a/android/module.go
+++ b/android/module.go
@@ -258,6 +258,8 @@
 	SkipInstall()
 	IsSkipInstall() bool
 	MakeUninstallable()
+	ReplacedByPrebuilt()
+	IsReplacedByPrebuilt() bool
 	ExportedToMake() bool
 	InitRc() Paths
 	VintfFragments() Paths
@@ -542,6 +544,9 @@
 
 	SkipInstall bool `blueprint:"mutated"`
 
+	// Whether the module has been replaced by a prebuilt
+	ReplacedByPrebuilt bool `blueprint:"mutated"`
+
 	// Disabled by mutators. If set to true, it overrides Enabled property.
 	ForcedDisabled bool `blueprint:"mutated"`
 
@@ -1067,6 +1072,15 @@
 	m.SkipInstall()
 }
 
+func (m *ModuleBase) ReplacedByPrebuilt() {
+	m.commonProperties.ReplacedByPrebuilt = true
+	m.SkipInstall()
+}
+
+func (m *ModuleBase) IsReplacedByPrebuilt() bool {
+	return m.commonProperties.ReplacedByPrebuilt
+}
+
 func (m *ModuleBase) ExportedToMake() bool {
 	return m.commonProperties.NamespaceExportedToMake
 }