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

Commit 4a3e79cf authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix bug 5080988 - State change to action views made in onPrepareOptionsMenu will be lost"

parents 734b14d6 97a30017
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -392,6 +392,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            // Preparing the panel menu can involve a lot of manipulation;
            // don't dispatch change events to presenters until we're done.
            st.menu.stopDispatchingItemsChanged();

            // Restore action view state before we prepare. This gives apps
            // an opportunity to override frozen/restored state in onPrepare.
            if (st.frozenActionViewState != null) {
                st.menu.restoreActionViewStates(st.frozenActionViewState);
                st.frozenActionViewState = null;
            }

            if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) {
                st.menu.startDispatchingItemsChanged();
                return false;
@@ -410,11 +418,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        st.isHandled = false;
        mPreparedPanel = st;

        if (st.frozenActionViewState != null) {
            st.menu.restoreActionViewStates(st.frozenActionViewState);
            st.frozenActionViewState = null;
        }

        return true;
    }