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

Commit 1917df1a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "base: fix ClassCastException in MenuPopupWindow"

parents 1b4ccdbc 2f1f2ccf
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -138,7 +138,15 @@ public class MenuPopupWindow extends ListPopupWindow implements MenuItemHoverLis
                setNextSelectedPositionInt(INVALID_POSITION);

                // Close only the top-level menu.
                ((MenuAdapter) getAdapter()).getAdapterMenu().close(false /* closeAllMenus */);
                final ListAdapter adapter = getAdapter();
                final MenuAdapter menuAdapter;
                if (adapter instanceof HeaderViewListAdapter) {
                    final HeaderViewListAdapter headerAdapter = (HeaderViewListAdapter) adapter;
                    menuAdapter = (MenuAdapter) headerAdapter.getWrappedAdapter();
                } else {
                    menuAdapter = (MenuAdapter) adapter;
                }
                menuAdapter.getAdapterMenu().close(false /* closeAllMenus */);
                return true;
            }
            return super.onKeyDown(keyCode, event);