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

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

Merge "More detailed error reporting for AbsListView/CHOICE_MODE_MULTIPLE_MODAL" into jb-mr1-dev

parents 0b23b5f6 a798170f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -973,6 +973,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te

        // Start selection mode if needed. We don't need to if we're unchecking something.
        if (value && mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode == null) {
            if (mMultiChoiceModeCallback == null ||
                    !mMultiChoiceModeCallback.hasWrappedCallback()) {
                throw new IllegalStateException("AbsListView: attempted to start selection mode " +
                        "for CHOICE_MODE_MULTIPLE_MODAL but no choice mode callback was " +
                        "supplied. Call setMultiChoiceModeListener to set a callback.");
            }
            mChoiceActionMode = startActionMode(mMultiChoiceModeCallback);
        }

@@ -5945,6 +5951,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            mWrapped = wrapped;
        }

        public boolean hasWrappedCallback() {
            return mWrapped != null;
        }

        public boolean onCreateActionMode(ActionMode mode, Menu menu) {
            if (mWrapped.onCreateActionMode(mode, menu)) {
                // Initialize checked graphic state?