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

Commit 421f5f83 authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

[WM] Clean up requestAssistScreenshot function

Bug: 409979948
Flag: EXEMPT code cleanup
Test: presubmit, AssistDataRequesterTest
Change-Id: Icef2027252d6c7076dee6dd0f9006171e86b7376
parent 42191190
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@ interface IWindowManager
    /**
     * Used only for assist -- request a screenshot of the current application.
     */
    boolean requestAssistScreenshot(IAssistDataReceiver receiver);
    void requestAssistScreenshot(IAssistDataReceiver receiver);

    /**
     * Called by System UI to notify Window Manager to hide transient bars.
+8 −6
Original line number Diff line number Diff line
@@ -4292,12 +4292,16 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    /**
     * Takes a snapshot of the screen.  In landscape mode this grabs the whole screen.
     * In portrait mode, it grabs the upper region of the screen based on the vertical dimension
     * of the target image.
     * Requests a screenshot to be taken for Assist purposes.
     *
     * This method initiates the process of capturing the current screen content and delivering it
     * to the provided {@link IAssistDataReceiver}.
     *
     * @param receiver The {@link IAssistDataReceiver} that will receive the screenshot bitmap. Must
     * not be null.
     */
    @Override
    public boolean requestAssistScreenshot(final IAssistDataReceiver receiver) {
    public void requestAssistScreenshot(final IAssistDataReceiver receiver) {
        final ScreenshotHardwareBuffer shb = takeAssistScreenshot(/* predicate= */ null);
        final Bitmap bm = shb != null ? shb.asBitmap() : null;
        FgThread.getHandler().post(() -> {
@@ -4306,8 +4310,6 @@ public class WindowManagerService extends IWindowManager.Stub
            } catch (RemoteException e) {
            }
        });

        return true;
    }

    /**