diff options
| author | 2021-02-15 12:02:54 +0900 | |
|---|---|---|
| committer | 2021-02-15 14:47:58 +0900 | |
| commit | 5156e5b8910d3e99966de78cb2a5692c4b3aa360 (patch) | |
| tree | 2d490b8f9b84729d5e8cb2e33fe68601855a131b /libs/gui/QueueBufferInputOutput.cpp | |
| parent | f7f4a9afb307d89923da59344481d8a4b52dfd36 (diff) | |
libbinder: fix ToString() for smart pointers
android::internal::ToString() is a helper to provide implementation of
AIDL-generated type's toString/gen_log features.
For now, AIDL IBinder type is mapped to sp<IBinder> in the C++ backend,
and ToString() handles it as a pointer-like type. But when there's a
HIDL-generated toString(sp<IFoo>) function in the same scope, ToString()
tries to use it for sp<IBinder> because sp<T> can is constuctible from
sp<U>.
To avoid such ambiguities,
- IsPointerLike is checked before HasToStringFunction, so that
sp<IBinder> is treated as a pointer even when there's an overloaded
toString(sp<T>) function.
- IsPointerLike now explicitly checks if the target type is an
instatiation of of one of android::sp/std::optional/std::shared_ptr.
Bug: 179885793
Test: m
Change-Id: I884d8be92ed744237d7bf44d381437426f37045a
Diffstat (limited to 'libs/gui/QueueBufferInputOutput.cpp')
0 files changed, 0 insertions, 0 deletions