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

Commit 998e7f49 authored by Matt Casey's avatar Matt Casey
Browse files

Log.wtf if display list is empty.

This should never happen and is a significant issue if it does, as
it can prematurely end the screenshot pipeline.

Bug: 360843936
Test: Manually tested normal screenshot usage to ensure it doesn't
      trigger this case.
Flag: EXEMPT Adding log
Change-Id: I544cee1e09e4dccbd2c8bbd76eda0f4f9e63395b
parent 6990f576
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -99,6 +99,9 @@ constructor(
    ) {
        val displays = getDisplaysToScreenshot(screenshotRequest.type)
        val resultCallbackWrapper = MultiResultCallbackWrapper(requestCallback)
        if (displays.isEmpty()) {
            Log.wtf(TAG, "No displays found for screenshot.")
        }
        displays.forEach { display ->
            val displayId = display.displayId
            var screenshotHandler: ScreenshotHandler =
@@ -219,8 +222,7 @@ constructor(
    }

    private fun getScreenshotController(display: Display): InteractiveScreenshotHandler {
        val controller =
            screenshotController ?: interactiveScreenshotHandlerFactory.create(display)
        val controller = screenshotController ?: interactiveScreenshotHandlerFactory.create(display)
        screenshotController = controller
        return controller
    }