Parcelables
Binder for Rust supports sending parcelables directly:
birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl:
1. package com.example.birthdayservice;
3. parcelable BirthdayInfo {
4. String name;
5. int years;
6. }
birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl:
1. import com.example.birthdayservice.BirthdayInfo;
3. interface IBirthdayService {
4. /** The same thing, but with a parcelable. */
5. String wishWithInfo(in BirthdayInfo info);
6. }
birthday_service/src/client.rs:
1. fn main() {
2. binder::ProcessState::start_thread_pool();
3. let service = connect().expect("Failed to connect to BirthdayService");
5. let info = BirthdayInfo { name: "Alice".into(), years: 123 };
6. service.wishWithInfo(&info)?;
7. }
