Interfaces AIDL

VocĂȘ declara a API do seu serviço usando uma interface AIDL:

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

/** Interface de serviço de aniversårio. */
interface IBirthdayService {
    /** Gera uma mensagem de feliz aniversĂĄrio. */
    String wishHappyBirthday(String name, int years);
}

birthday_service/aidl/Android.bp:

aidl_interface {
    name: "com.example.birthdayservice",
    srcs: ["com/example/birthdayservice/*.aidl"],
    unstable: true,
    backend: {
        rust: { // Rust nĂŁo estĂĄ ativado por padrĂŁo
            enabled: true,
        },
    },
}
  • Note that the directory structure under the aidl/ directory needs to match the package name used in the AIDL file, i.e. the package is com.example.birthdayservice and the file is at aidl/com/example/IBirthdayService.aidl.