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

Commit 1db11ba0 authored by Ady Abraham's avatar Ady Abraham
Browse files

Move sync_wait for screen capture to client

Free up time from the SF's main thread by moving the fence waiting
to the client.

Test: Observe systrace of region sample thread
Test: adb shell screencap
Test: Recents takes the screenshot
Test: Rotate device
Test: Volume + power down for screenshot
Bug: 178649983
Change-Id: Ice70b8d2b95928a5adce19dbd1d91e73d8529f54
parent 9ce7fe21
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ public:
        }
    }

    binder::Status onScreenCaptureComplete(
    binder::Status onScreenCaptureCompleted(
            const gui::ScreenCaptureResults& captureResults) override {
        JNIEnv* env = getenv();
        if (captureResults.result != NO_ERROR || captureResults.buffer == nullptr) {
@@ -270,6 +270,7 @@ public:
                                gScreenCaptureListenerClassInfo.onScreenCaptureComplete, nullptr);
            return binder::Status::ok();
        }
        captureResults.fence->waitForever("");
        jobject jhardwareBuffer = android_hardware_HardwareBuffer_createFromAHardwareBuffer(
                env, captureResults.buffer->toAHardwareBuffer());
        const jint namedColorSpace =