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, }, }, }

Speaker Notes

  • Observe que a estrutura de diretĂłrios sob o diretĂłrio aidl/ precisa corresponder ao nome do pacote usado no arquivo AIDL, ou seja, o pacote Ă© com.example.birthdayservice e o arquivo estĂĄ em aidl/com/example/IBirthdayService.aidl.