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

Commit af897e3e authored by Aran Ink's avatar Aran Ink Committed by Android (Google) Code Review
Browse files

Merge "Prevent NPE when GlobalActions items are clicked while the dialog isn't showing."

parents 013c7d23 baa2586e
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1021,7 +1021,11 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        public boolean onLongClickItem(int position) {
            final Action action = mAdapter.getItem(position);
            if (action instanceof LongPressAction) {
                if (mDialog != null) {
                    mDialog.dismiss();
                } else {
                    Log.w(TAG, "Action long-clicked while mDialog is null.");
                }
                return ((LongPressAction) action).onLongPress();
            }
            return false;
@@ -1031,10 +1035,14 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        public void onClickItem(int position) {
            Action item = mAdapter.getItem(position);
            if (!(item instanceof SilentModeTriStateAction)) {
                if (mDialog != null) {
                    mDialog.dismiss();
                } else {
                    Log.w(TAG, "Action clicked while mDialog is null.");
                }
                item.onPress();
            }
        }

        @Override
        public boolean shouldBeSeparated(int position) {