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

Commit 414972ff authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

gui: explicitly crash in Surface's ctor if bufferProducer is null



it will crash anyway, but this way crash is
easier to debug.

Bug: 412426167
Test: presubmit
Flag: EXEMPT no behavior change
Change-Id: I1132a7e669a9c536818f2fbd31e3d0bfff7a408a
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
parent 78d45e8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ Surface::Surface(const sp<IGraphicBufferProducer>& bufferProducer, bool controll
        mFrameTimestampsSupportsPresent(false),
        mEnableFrameTimestamps(false),
        mFrameEventHistory(std::make_unique<ProducerFrameEventHistory>()) {
    LOG_ALWAYS_FATAL_IF(!mGraphicBufferProducer); // it will crash anyway

    // Initialize the ANativeWindow function pointers.
    ANativeWindow::setSwapInterval  = hook_setSwapInterval;
    ANativeWindow::dequeueBuffer    = hook_dequeueBuffer;