Enforce hidden api usage in vendor (soong)

From aosp/588578, if vendor app doesn't fill sdk_version, build scirpt overwrites system_current to sdk_version.
But there is no similar enforcement in soong.

So, as make does, sdkVersion() returns "system_current" if it is device-specific or soc-specific module. and sdk_version is not filled.

Test: pass soong test
Bug: 132780927

Change-Id: I69bb3d7bfcf7c27c2db4d0efbe046f9c7879b4bc
This commit is contained in:
Jeongik Cha
2019-06-25 16:26:18 +09:00
parent 7dc6951c3d
commit 6bd33c13bb
4 changed files with 43 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import (
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
var (
@@ -523,7 +524,7 @@ func JavadocHostFactory() android.Module {
var _ android.OutputFileProducer = (*Javadoc)(nil)
func (j *Javadoc) sdkVersion() string {
return String(j.properties.Sdk_version)
return proptools.StringDefault(j.properties.Sdk_version, defaultSdkVersion(j))
}
func (j *Javadoc) minSdkVersion() string {