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

Commit 64ab0490 authored by Sunny Goyal's avatar Sunny Goyal Committed by android-build-merger
Browse files

Merge "Fixing missing reportDrawFinish method in windowCallbacksCompat" into pi-dev

am: 5000367d

Change-Id: I4c2d4cbef2f3cae9c9f61c1a5fa5126b26d10aa7
parents 71d46274 5000367d
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -60,6 +60,12 @@ public class WindowCallbacksCompat {
        }
    };

    private final View mView;

    public WindowCallbacksCompat(View view) {
        mView = view;
    }

    public void onWindowSizeIsChanging(Rect newBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets) { }

@@ -72,12 +78,20 @@ public class WindowCallbacksCompat {
        return false;
    }

    public void onRequestDraw(boolean reportNextDraw) { }
    public void onRequestDraw(boolean reportNextDraw) {
        if (reportNextDraw) {
            reportDrawFinish();
        }
    }

    public void onPostDraw(Canvas canvas) { }

    public final boolean addToView(View view) {
        ViewRootImpl root = view.getViewRootImpl();
    public void reportDrawFinish() {
        mView.getViewRootImpl().reportDrawFinish();
    }

    public boolean attach() {
        ViewRootImpl root = mView.getViewRootImpl();
        if (root != null) {
            root.addWindowCallbacks(mWindowCallbacks);
            root.requestInvalidateRootRenderNode();
@@ -86,8 +100,8 @@ public class WindowCallbacksCompat {
        return false;
    }

    public final void removeFromView(View view) {
        ViewRootImpl root = view.getViewRootImpl();
    public void detach() {
        ViewRootImpl root = mView.getViewRootImpl();
        if (root != null) {
            root.removeWindowCallbacks(mWindowCallbacks);
        }