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

Commit a16cc15f authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Make sure starting windows only draw once

The panel menu was invalidated, and thus a runnable was posted for
the next frame, to update the panel menu, and invalidate the view. We
avoid this by not invalidating the panel menu for starting windows.

Bug: 20949632
Change-Id: I67ca47e3a7ce3ba1d685c2313efa66fb1cdee312
parent 1fad138f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    private Rect mTempRect;
    private Rect mOutsets = new Rect();

    private boolean mIsStartingWindow;

    static class WindowManagerHolder {
        static final IWindowManager sWindowManager = IWindowManager.Stub.asInterface(
                ServiceManager.getService("window"));
@@ -3891,7 +3893,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                // A pending invalidation will typically be resolved before the posted message
                // would run normally in order to satisfy instance state restoration.
                PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
                if (!isDestroyed() && (st == null || st.menu == null)) {
                if (!isDestroyed() && (st == null || st.menu == null) && !mIsStartingWindow) {
                    invalidatePanelMenu(FEATURE_ACTION_BAR);
                }
            } else {
@@ -4966,4 +4968,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            mDecor.updateColorViews(null, false /* animate */);
        }
    }

    public void setIsStartingWindow(boolean isStartingWindow) {
        mIsStartingWindow = isStartingWindow;
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -2154,7 +2154,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
            }

            Window win = new PhoneWindow(context);
            PhoneWindow win = new PhoneWindow(context);
            win.setIsStartingWindow(true);
            final TypedArray ta = win.getWindowStyle();
            if (ta.getBoolean(
                        com.android.internal.R.styleable.Window_windowDisablePreview, false)