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

Commit 832a7dc8 authored by Sara Ting's avatar Sara Ting
Browse files

Only query visible calendars for autocomplete of recent titles/locations.

Bug:6636507
Change-Id: Icba76184775cbb3c2a7555b16280f11a72f4104c
parent 21b4317c
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) {