Rust: Add stability support to binder services
Set vintf interface stability when creating Binder Rust services, when
applicable. Pass FLAG_PRIVATE_LOCAL on transactions for compatibility
with vendor services.
Test: atest aidl_integration_test
Bug: 179907868
Change-Id: Ife61d33e816a98f3248c5b944e6484850f89bf59
diff --git a/generate_rust.cpp b/generate_rust.cpp
index bcfb203..0b36ff6 100644
--- a/generate_rust.cpp
+++ b/generate_rust.cpp
@@ -105,6 +105,7 @@
vector<string> flags;
if (method.IsOneway()) flags.push_back("binder::FLAG_ONEWAY");
if (iface.IsSensitiveData()) flags.push_back("binder::FLAG_CLEAR_BUF");
+ flags.push_back("binder::FLAG_PRIVATE_LOCAL");
string transact_flags = flags.empty() ? "0" : Join(flags, " | ");
out << "let _aidl_reply = self.binder.transact("
@@ -383,6 +384,9 @@
code_writer->Dedent();
*code_writer << "},\n";
code_writer->Dedent();
+ if (iface->IsVintfStability()) {
+ *code_writer << "stability: binder::Stability::Vintf,\n";
+ }
*code_writer << "}\n";
code_writer->Dedent();
*code_writer << "}\n";