Filter bad calendar events.

Events expanded beyond 2038 were causing eventStatus crashes.

Events past 2038 were getting inserted into the database with a dtstart of -1
and lastDate of NULL.  This caused the SQL query in expandInstanceRangeLocked
to pick up the event.  Then, because dtendMillis was < end, the code assumed
it must be a recurrence exception and canceled it.  The later code that
removes recurrence exceptions ignored the event because it wasn't a recurrence
exception, leaving the cancel in the ContentValues, causing a database error.
Thus, multiple errors had to exist to cause this bug.

The bug is no longer active, since some of the steps in the chain of events
have already been fixed.  This change fixes the step that assumes the
event is a recurrence exception, which will make the code more robust.

Bug: 1705312
1 file changed