Fix bug #2331761 (Instances of a recurring event are missing)
by detecting and ignoring malformed recurrences Change-Id: I4b3aa5db27d8da6616b52fdc7b522d4d92fdc30c
This commit is contained in:
@@ -48,7 +48,8 @@ public class RecurrenceSet {
|
||||
* events table in the CalendarProvider.
|
||||
* @param values The values retrieved from the Events table.
|
||||
*/
|
||||
public RecurrenceSet(ContentValues values) {
|
||||
public RecurrenceSet(ContentValues values)
|
||||
throws EventRecurrence.InvalidFormatException {
|
||||
String rruleStr = values.getAsString(Calendar.Events.RRULE);
|
||||
String rdateStr = values.getAsString(Calendar.Events.RDATE);
|
||||
String exruleStr = values.getAsString(Calendar.Events.EXRULE);
|
||||
@@ -65,7 +66,8 @@ public class RecurrenceSet {
|
||||
* @param cursor The cursor containing the RRULE, RDATE, EXRULE, and EXDATE
|
||||
* columns.
|
||||
*/
|
||||
public RecurrenceSet(Cursor cursor) {
|
||||
public RecurrenceSet(Cursor cursor)
|
||||
throws EventRecurrence.InvalidFormatException {
|
||||
int rruleColumn = cursor.getColumnIndex(Calendar.Events.RRULE);
|
||||
int rdateColumn = cursor.getColumnIndex(Calendar.Events.RDATE);
|
||||
int exruleColumn = cursor.getColumnIndex(Calendar.Events.EXRULE);
|
||||
@@ -78,12 +80,14 @@ public class RecurrenceSet {
|
||||
}
|
||||
|
||||
public RecurrenceSet(String rruleStr, String rdateStr,
|
||||
String exruleStr, String exdateStr) {
|
||||
String exruleStr, String exdateStr)
|
||||
throws EventRecurrence.InvalidFormatException {
|
||||
init(rruleStr, rdateStr, exruleStr, exdateStr);
|
||||
}
|
||||
|
||||
private void init(String rruleStr, String rdateStr,
|
||||
String exruleStr, String exdateStr) {
|
||||
String exruleStr, String exdateStr)
|
||||
throws EventRecurrence.InvalidFormatException {
|
||||
if (!TextUtils.isEmpty(rruleStr) || !TextUtils.isEmpty(rdateStr)) {
|
||||
|
||||
if (!TextUtils.isEmpty(rruleStr)) {
|
||||
|
||||
Reference in New Issue
Block a user