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

Commit 6446d83a authored by Brian Attwell's avatar Brian Attwell
Browse files

Only display calendar events with last_synced=0

Bug: 18034745
Change-Id: I98e7182c52e1cb58b354952c3788f1770d1d368e
parent 9f5be98a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -96,13 +96,18 @@ public class CalendarInteractionsLoader extends AsyncTaskLoader<List<ContactInte
                String.valueOf(futureTimeCutoff)};
        selectionArgs.addAll(Arrays.asList(timeArguments));

        // When LAST_SYNCED = 1, the event is not a real event. We should ignore all such events.
        String IS_NOT_TEMPORARY_COPY_OF_LOCAL_EVENT
                = CalendarContract.Attendees.LAST_SYNCED + " = 0";

        String orderBy = CalendarContract.Attendees.DTSTART + (isFuture ? " ASC " : " DESC ");
        String selection = caseAndDotInsensitiveEmailComparisonClause(mEmailAddresses.size())
                + " AND " + CalendarContract.Attendees.CALENDAR_ID
                + " IN " + ContactInteractionUtil.questionMarks(calendarIds.size())
                + " AND " + CalendarContract.Attendees.DTSTART + timeOperator + " ? "
                + " AND " + CalendarContract.Attendees.DTSTART + " > ? "
                + " AND " + CalendarContract.Attendees.DTSTART + " < ? ";
                + " AND " + CalendarContract.Attendees.DTSTART + " < ? "
                + " AND " + IS_NOT_TEMPORARY_COPY_OF_LOCAL_EVENT;

        return getContext().getContentResolver().query(CalendarContract.Attendees.CONTENT_URI,
                /* projection = */ null, selection,