Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58e1ce0b authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

sf: avoid assumption remote binder is local am: 4271f564

Change-Id: If5eac57b39b2679782416edc8c3296e9be358a14
parents 926b76a5 4271f564
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -200,9 +200,10 @@ RegionSamplingThread::~RegionSamplingThread() {

void RegionSamplingThread::addListener(const Rect& samplingArea, const sp<IBinder>& stopLayerHandle,
                                       const sp<IRegionSamplingListener>& listener) {
    wp<Layer> stopLayer = stopLayerHandle != nullptr
            ? static_cast<Layer::Handle*>(stopLayerHandle.get())->owner
            : nullptr;
    wp<Layer> stopLayer;
    if (stopLayerHandle != nullptr && stopLayerHandle->localBinder() != nullptr) {
        stopLayer = static_cast<Layer::Handle*>(stopLayerHandle.get())->owner;
    }

    sp<IBinder> asBinder = IInterface::asBinder(listener);
    asBinder->linkToDeath(this);