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

Commit 059ec3a2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adds logging for debugging when the takeScreenshot is called." into main

parents da4bd12f 0e02a293
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1386,21 +1386,25 @@ public final class UiAutomation {
    @Nullable
    public Bitmap takeScreenshot(@NonNull Window window) {
        if (window == null) {
            Log.e(LOG_TAG, "Window is null");
            return null;
        }

        View decorView = window.peekDecorView();
        if (decorView == null) {
            Log.e(LOG_TAG, "Decor view is null");
            return null;
        }

        ViewRootImpl viewRoot = decorView.getViewRootImpl();
        if (viewRoot == null) {
            Log.e(LOG_TAG, "View root is null");
            return null;
        }

        SurfaceControl sc = viewRoot.getSurfaceControl();
        if (!sc.isValid()) {
            Log.e(LOG_TAG, "ViewRootImpl SurfaceControl is not valid");
            return null;
        }