aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2022-04-12 17:01:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-04-12 17:01:50 +0000
commit66ab22ced2e3e30069a68a2857b3f2964daf2890 (patch)
treeb64c7fc1bb1d5fc7adff9edcc0c4419f03be0b2f
parente26acaef7997efa568d433598d3082b81f402af8 (diff)
parented0490c75a339a9c997827282a827fe721836e06 (diff)
downloadaidl-66ab22ced2e3e30069a68a2857b3f2964daf2890.tar.gz
Merge "Java: require interfaceVersion/hash for ToT vers." into tm-dev
-rw-r--r--build/aidl_interface_backends.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/build/aidl_interface_backends.go b/build/aidl_interface_backends.go
index 128eee29..62a167ce 100644
--- a/build/aidl_interface_backends.go
+++ b/build/aidl_interface_backends.go
@@ -81,7 +81,7 @@ func addCppLibrary(mctx android.LoadHookContext, i *aidlInterface, version strin
Lang: lang,
BaseName: i.ModuleBase.Name(),
GenLog: genLog,
- Version: i.versionForAidlGenRule(version),
+ Version: i.versionForInitVersionCompat(version),
GenTrace: genTrace,
Unstable: i.properties.Unstable,
NotFrozen: notFrozen,
@@ -229,7 +229,7 @@ func addJavaLibrary(mctx android.LoadHookContext, i *aidlInterface, version stri
Platform_apis: proptools.Bool(i.properties.Backend.Java.Platform_apis),
Lang: langJava,
BaseName: i.ModuleBase.Name(),
- Version: i.versionForAidlGenRule(version),
+ Version: version,
GenRpc: proptools.Bool(i.properties.Backend.Java.Gen_rpc),
GenTrace: proptools.Bool(i.properties.Gen_trace),
Unstable: i.properties.Unstable,
@@ -280,7 +280,7 @@ func addRustLibrary(mctx android.LoadHookContext, i *aidlInterface, version stri
Min_sdk_version: i.minSdkVersion(langRust),
Lang: langRust,
BaseName: i.ModuleBase.Name(),
- Version: i.versionForAidlGenRule(version),
+ Version: i.versionForInitVersionCompat(version),
Unstable: i.properties.Unstable,
NotFrozen: notFrozen,
Flags: i.flagsForAidlGenRule(version),
@@ -343,7 +343,10 @@ func (i *aidlInterface) srcsForVersion(mctx android.EarlyModuleContext, version
}
}
-func (i *aidlInterface) versionForAidlGenRule(version string) string {
+// For certain backend, avoid a difference between the initial version of a versioned
+// interface and an unversioned interface. This ensures that prebuilts can't prevent
+// an interface from switching from unversioned to versioned.
+func (i *aidlInterface) versionForInitVersionCompat(version string) string {
if !i.hasVersion() {
return ""
}