Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] stop shipping aidl implementation headers in the NDK #1307

@atsushieno

Description

@atsushieno

Description

There was an API breaking change that was suddenly introduced at NDK 21.3..6528147, and to make it worse, this breaks ANY native binder service implementation derived from BnCInterface which is automatically generated by aidl(.exe).

$ diff -ur ~/Android/Sdk/ndk/21.2.6472646/sysroot/usr/include/ ~/Android/Sdk/ndk/21.3.6528147/sysroot/usr/include/ | grep SharedRefBase
     std::weak_ptr<SharedRefBase> mThis;
+    // Use 'SharedRefBase::make<T>(...)' to make. SharedRefBase has implicit

The problematic file is binder_interface_utils.h.

With NDK 21.3..6528147, it became simply impossible to define a service implementation class that is derived from the abstract class for the AIDL generated by aidl(.exe), because the generated class itself is abstract and therefore SharedRefBase::make() does not accept it. And we cannot define the derived class without making appropriate base constructor to BnCInterface which is now simply impossible.

To my understanding, this new operator must not be defined at SharedRefBase.

As long as I searched for any usage of BNCInterface at cs.android.com, it is totally untested. https://cs.android.com/search?q=BNCInterface

Environment Details

Not all of these will be relevant to every bug, but please provide as much
information as you can.

  • NDK Version: 21.3.6528147
  • Build system: sysroot/usr/include
  • Host OS: Linux (Ubuntu 20.04)
  • ABI: i686 (should be any)
  • NDK API level: 29
  • Device API level: 29 (should be irrelevant)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions