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

Commit dab989bf authored by Sara Ting's avatar Sara Ting Committed by Android (Google) Code Review
Browse files

Merge "Only query visible calendars for autocomplete of recent...

Merge "Only query visible calendars for autocomplete of recent titles/locations." into ics-ub-calendar-burgundy
parents ba889244 832a7dc8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -112,10 +112,13 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa
    private static final String[] EVENT_PROJECTION = new String[] {
        Events._ID,
        Events.TITLE,
        Events.VISIBLE,
    };
    private static final int EVENT_INDEX_ID = 0;
    private static final int EVENT_INDEX_TITLE = 1;
    private static final String TITLE_WHERE = Events.TITLE + " LIKE ?";
    private static final int EVENT_INDEX_VISIBLE = 2;
    private static final String TITLE_WHERE = Events.VISIBLE + "=? AND "
            + Events.TITLE + " LIKE ?";
    private static final int MAX_TITLE_SUGGESTIONS = 4;

    ArrayList<View> mEditOnlyList = new ArrayList<View>();
@@ -689,7 +692,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa
            // remove dupes.  We will order query results by descending event ID to show
            // results that were most recently inputted.
            Cursor tempCursor = mContentResolver.query(Events.CONTENT_URI, EVENT_PROJECTION,
                    TITLE_WHERE, new String[] { filter }, Events._ID + " DESC");
                    TITLE_WHERE, new String[] { "1", filter }, Events._ID + " DESC");
            if (tempCursor != null) {
                try {
                    // Post process query results.
+5 −2
Original line number Diff line number Diff line
@@ -126,10 +126,13 @@ public class EventLocationAdapter extends ArrayAdapter<EventLocationAdapter.Resu
    private static final String[] EVENT_PROJECTION = new String[] {
        Events._ID,
        Events.EVENT_LOCATION,
        Events.VISIBLE,
    };
    private static final int EVENT_INDEX_ID = 0;
    private static final int EVENT_INDEX_LOCATION = 1;
    private static final String LOCATION_WHERE = Events.EVENT_LOCATION + " LIKE ?";
    private static final int EVENT_INDEX_VISIBLE = 2;
    private static final String LOCATION_WHERE = Events.VISIBLE + "=? AND "
            + Events.EVENT_LOCATION + " LIKE ?";
    private static final int MAX_LOCATION_SUGGESTIONS = 4;

    private final ContentResolver mResolver;
@@ -428,7 +431,7 @@ public class EventLocationAdapter extends ArrayAdapter<EventLocationAdapter.Resu
        // remove dupes.  We will order query results by descending event ID to show
        // results that were most recently inputed.
        Cursor c = resolver.query(Events.CONTENT_URI, EVENT_PROJECTION, LOCATION_WHERE,
                new String[] { filter }, Events._ID + " DESC");
                new String[] { "1", filter }, Events._ID + " DESC");
        try {
            List<Result> recentLocations = null;
            if (c != null) {