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

Commit 3cff56b6 authored by Chris Banes's avatar Chris Banes
Browse files

Fix onPrepareActionMode() not being called

Happens because mActionMode was set at the end
of the call, which means that invalidate() doesn't
actually do anything.

BUG: 28392319
Change-Id: Ifdc97c03dc43bfbe74790f90764d1575bd9ca951
parent e12d62bd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -505,6 +505,9 @@ public class WindowDecorActionBar extends ActionBar implements
        mContextView.killMode();
        ActionModeImpl mode = new ActionModeImpl(mContextView.getContext(), callback);
        if (mode.dispatchOnCreate()) {
            // This needs to be set before invalidate() so that it calls
            // onPrepareActionMode()
            mActionMode = mode;
            mode.invalidate();
            mContextView.initForMode(mode);
            animateToMode(true);
@@ -518,7 +521,6 @@ public class WindowDecorActionBar extends ActionBar implements
                }
            }
            mContextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
            mActionMode = mode;
            return mode;
        }
        return null;