I'm using AOSP source file.I have created new service in Android 9 & it was running. When I tried to reuse the same in Android 11, getting API Lint Error from auto generated file (out folder)
1. IHelloworldService.java:43: error: Methods calling system APIs should rethrow RemoteException
as RuntimeException
(but do not list it in the throws clause) [RethrowRemoteException]
2. IHelloworldService.java:15: error: Raw AIDL interfaces must not be exposed: Stub extends Binder [RawAidl]
3. IHelloworldService.java:10: error: Missing nullability on method asBinder
return [MissingNullability]
I unable to try what is emitted in the terminal, (method 1 is not possible, since autogenerated file; method 1 is not possible, since mentioned folder is not available )
Can anyone help me with how to solve this? stuck for long time
Because it is system APIs, so you need add /** {@hide} */comment, can solve this, like this
package android.service.cfm880;
/** {@hide} */
interface IHelloService{
void hello(in String name);
}
current newest aosp master branch can work
You may override the bp file.Then add/override metalava_framework_docs_args section.
metalava_framework_docs_args = "
"--api-lint-ignore-prefix replace_with_your_class_name_or_prefix "
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With