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

Commit 1a1ff74b authored by Jan Althaus's avatar Jan Althaus Committed by android-build-merger
Browse files

Merge "Fixing broken logging of OTHER events" into pi-dev

am: 706edbd7

Change-Id: Id4a2866e93e1c03c1e7a6b236175f2faae4cd6f6
parents 935210c8 706edbd7
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -348,6 +348,7 @@ public final class SelectionEvent implements Parcelable {
            case SelectionEvent.ACTION_ABANDON:  // fall through
            case SelectionEvent.ACTION_ABANDON:  // fall through
            case SelectionEvent.ACTION_SELECT_ALL:  // fall through
            case SelectionEvent.ACTION_SELECT_ALL:  // fall through
            case SelectionEvent.ACTION_RESET:  // fall through
            case SelectionEvent.ACTION_RESET:  // fall through
            case SelectionEvent.ACTION_OTHER:  // fall through
                return;
                return;
            default:
            default:
                throw new IllegalArgumentException(
                throw new IllegalArgumentException(
+25 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,31 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@RunWith(AndroidJUnit4.class)
public class SelectionEventTest {
public class SelectionEventTest {


    @Test
    public void testCreateSelectionActionEvent_valid() {
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_OVERTYPE);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_COPY);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_PASTE);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_CUT);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SHARE);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SMART_SHARE);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_DRAG);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_ABANDON);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_OTHER);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SELECT_ALL);
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_RESET);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testCreateSelectionActionEvent_badRange() {
        SelectionEvent.createSelectionActionEvent(0, -1, SelectionEvent.ACTION_OVERTYPE);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testCreateSelectionActionEvent_badAction() {
        SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.EVENT_SELECTION_STARTED);
    }

    @Test
    @Test
    public void testParcel() {
    public void testParcel() {
        final SelectionEvent event = SelectionEvent.createSelectionStartedEvent(
        final SelectionEvent event = SelectionEvent.createSelectionStartedEvent(