Loading services/surfaceflinger/SurfaceFlinger.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -5663,7 +5663,10 @@ void SurfaceFlinger::SetInputWindowsListener::onSetInputWindowsFinished() { } sp<Layer> SurfaceFlinger::fromHandle(const sp<IBinder>& handle) { BBinder *b = handle->localBinder(); BBinder* b = nullptr; if (handle) { b = handle->localBinder(); } if (b == nullptr) { return nullptr; } Loading services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h +5 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,11 @@ public: auto& mutableInternalHwcDisplayId() { return getHwComposer().mInternalHwcDisplayId; } auto& mutableExternalHwcDisplayId() { return getHwComposer().mExternalHwcDisplayId; } auto fromHandle(const sp<IBinder>& handle) { Mutex::Autolock _l(mFlinger->mStateLock); return mFlinger->fromHandle(handle); } ~TestableSurfaceFlinger() { // All these pointer and container clears help ensure that GMock does // not report a leaked object, since the SurfaceFlinger instance may Loading services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -315,4 +315,9 @@ TEST_F(TransactionApplicationTest, BlockWithPriorTransaction_SyncInputWindows) { BlockedByPriorTransaction(/*flags*/ 0, /*syncInputWindows*/ true); } TEST_F(TransactionApplicationTest, FromHandle) { sp<IBinder> badHandle; auto ret = mFlinger.fromHandle(badHandle); EXPECT_EQ(nullptr, ret.get()); } } // namespace android Loading
services/surfaceflinger/SurfaceFlinger.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -5663,7 +5663,10 @@ void SurfaceFlinger::SetInputWindowsListener::onSetInputWindowsFinished() { } sp<Layer> SurfaceFlinger::fromHandle(const sp<IBinder>& handle) { BBinder *b = handle->localBinder(); BBinder* b = nullptr; if (handle) { b = handle->localBinder(); } if (b == nullptr) { return nullptr; } Loading
services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h +5 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,11 @@ public: auto& mutableInternalHwcDisplayId() { return getHwComposer().mInternalHwcDisplayId; } auto& mutableExternalHwcDisplayId() { return getHwComposer().mExternalHwcDisplayId; } auto fromHandle(const sp<IBinder>& handle) { Mutex::Autolock _l(mFlinger->mStateLock); return mFlinger->fromHandle(handle); } ~TestableSurfaceFlinger() { // All these pointer and container clears help ensure that GMock does // not report a leaked object, since the SurfaceFlinger instance may Loading
services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -315,4 +315,9 @@ TEST_F(TransactionApplicationTest, BlockWithPriorTransaction_SyncInputWindows) { BlockedByPriorTransaction(/*flags*/ 0, /*syncInputWindows*/ true); } TEST_F(TransactionApplicationTest, FromHandle) { sp<IBinder> badHandle; auto ret = mFlinger.fromHandle(badHandle); EXPECT_EQ(nullptr, ret.get()); } } // namespace android