summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2022-07-26 18:29:58 +0000
committer Steven Moreland <smoreland@google.com> 2022-07-26 19:42:07 +0000
commit3acd490d74b6a970db741fb140c63c7015f976f9 (patch)
treed77ae9a4eb374ed12906fa72c617ee39fc7f167e /services/surfaceflinger/RegionSamplingThread.cpp
parentdcc3db7bd101a67010d2739b75ac3869a4417bf2 (diff)
libbinder_ndk: avoid BpRefBase
This is OBJECT_LIFETIME_WEAK which makes things complicated. The goal of this is to be able to support this kind of thing: sp<IFoo> foo = ... // get service; wp<IFoo> wFoo = foo; foo = nullptr; sp<IFoo> foo2 = ... // get service again; EXPECT_EQ(wFoo.promote(), foo2); However, because ABpBinder onLastStrongRef expunged the wp binder reference, this did not work in the NDK backend of binder before. This works for BpBinder because BpBinder does not call expungeHandle until ~BpBinder. However, because we need the reference from our BpBinder to the BpRefBase, it becomes circular. I'm not sure, with the current implementation of RefBase, it would be possible to get this behavior. In the future, if we wanted it, we could make all BpBinder objects also be ABpBinder objects. This would avoid the extra allocation and avoid the need for the proxy object. Bug: 220141324 Test: CtsNdkBinderTestCases Change-Id: I934a12baec625da1c3a0d5052d446523dc4c1f89
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
0 files changed, 0 insertions, 0 deletions