diff options
author | Steven Moreland <smoreland@google.com> | 2020-03-24 22:55:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-03-24 22:55:28 +0000 |
commit | 58e1ce0b3b6881d2ac3ff3bfd4b0548c121286ea (patch) | |
tree | 768e86dc9c2fce319f10adb7a7c09158921a5ea9 | |
parent | 926b76a5193cfe5fbaef78649ff5e2db34b215a7 (diff) | |
parent | 4271f564399e35186473ccd2d70b45bb5038c97a (diff) | |
download | android_frameworks_native-58e1ce0b3b6881d2ac3ff3bfd4b0548c121286ea.tar.gz android_frameworks_native-58e1ce0b3b6881d2ac3ff3bfd4b0548c121286ea.tar.bz2 android_frameworks_native-58e1ce0b3b6881d2ac3ff3bfd4b0548c121286ea.zip |
sf: avoid assumption remote binder is local am: 4271f56439
Change-Id: If5eac57b39b2679782416edc8c3296e9be358a14
-rw-r--r-- | services/surfaceflinger/RegionSamplingThread.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index 07fdead31..80da15427 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -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); |