AIDL Interfaces

You declare the API of your service using an AIDL interface:

birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl:

  1. package com.example.birthdayservice;
  2. /** Birthday service interface. */
  3. interface IBirthdayService {
  4. /** Generate a Happy Birthday message. */
  5. String wishHappyBirthday(String name, int years);
  6. }

birthday_service/aidl/Android.bp:

  1. aidl_interface {
  2. name: "com.example.birthdayservice",
  3. srcs: ["com/example/birthdayservice/*.aidl"],
  4. unstable: true,
  5. backend: {
  6. rust: { // Rust is not enabled by default
  7. enabled: true,
  8. },
  9. },
  10. }

Add vendor_available: true if your AIDL file is used by a binary in the vendor partition.