am 25b0f0ee: Add a PRE_BOOT_COMPLETED receiver.
diff --git a/src/com/android/providers/calendar/CalendarProvider2.java b/src/com/android/providers/calendar/CalendarProvider2.java
index a50f903..f4f8a34 100644
--- a/src/com/android/providers/calendar/CalendarProvider2.java
+++ b/src/com/android/providers/calendar/CalendarProvider2.java
@@ -1548,10 +1548,6 @@
duration = "P" + days + "D";
updatedValues.put(Events.DURATION, duration);
neededCorrection = true;
- } else if (duration.charAt(0) != 'P' ||
- duration.charAt(len - 1) != 'D') {
- throw new IllegalArgumentException("duration is not formatted correctly. " +
- "Should be 'P<seconds>S' or 'P<days>D'.");
}
}
@@ -2460,12 +2456,19 @@
// or if the event is local (no syncId)
if (callerIsSyncAdapter || emptySyncId) {
mDb.delete("Events", "_id=?", selectionArgs);
- mDb.delete("Attendees", "event_id=?", selectionArgs);
} else {
ContentValues values = new ContentValues();
values.put(Events.DELETED, 1);
values.put(Events._SYNC_DIRTY, 1);
mDb.update("Events", values, "_id=?", selectionArgs);
+
+ // Delete associated data; attendees, however, are deleted with the actual event so
+ // that the sync adapter is able to notify attendees of the cancellation.
+ mDb.delete("Instances", "event_id=?", selectionArgs);
+ mDb.delete("EventsRawTimes", "event_id=?", selectionArgs);
+ mDb.delete("Reminders", "event_id=?", selectionArgs);
+ mDb.delete("CalendarAlerts", "event_id=?", selectionArgs);
+ mDb.delete("ExtendedProperties", "event_id=?", selectionArgs);
}
}
} finally {
@@ -2477,14 +2480,6 @@
scheduleNextAlarm(false /* do not remove alarms */);
triggerAppWidgetUpdate(-1 /* changedEventId */);
}
-
- // Delete associated data; attendees, however, are deleted with the actual event so
- // that the sync adapter is able to notify attendees of the cancellation.
- mDb.delete("Instances", "event_id=?", selectionArgs);
- mDb.delete("EventsRawTimes", "event_id=?", selectionArgs);
- mDb.delete("Reminders", "event_id=?", selectionArgs);
- mDb.delete("CalendarAlerts", "event_id=?", selectionArgs);
- mDb.delete("ExtendedProperties", "event_id=?", selectionArgs);
return result;
}