OSDN Git Service

b/2593884 Clear out recurrence before updating.
authorErik <roboerik@android.com>
Tue, 13 Apr 2010 23:42:14 +0000 (16:42 -0700)
committerErik <roboerik@android.com>
Tue, 13 Apr 2010 23:42:14 +0000 (16:42 -0700)
Previously settings could be left over when we changed the recurrence.
This is handled by Google's servers but not by Exchange. This change
will clear out the recurrence setting before recreating it when the
recurrence is changed.

Change-Id: Ife9c6b1fd81723314e6e0fcb3249cf8bfca20cb2

src/com/android/calendar/EditEvent.java

index 2bb9e96..1f646b5 100644 (file)
@@ -1907,9 +1907,21 @@ public class EditEvent extends Activity implements View.OnClickListener,
         values.put(Events.DURATION, duration);
     }
 
+    private void clearRecurrence() {
+        mEventRecurrence.byday = null;
+        mEventRecurrence.bydayNum = null;
+        mEventRecurrence.bydayCount = 0;
+        mEventRecurrence.bymonth = null;
+        mEventRecurrence.bymonthCount = 0;
+        mEventRecurrence.bymonthday = null;
+        mEventRecurrence.bymonthdayCount = 0;
+    }
+
     private void updateRecurrenceRule() {
         int position = mRepeatsSpinner.getSelectedItemPosition();
         int selection = mRecurrenceIndexes.get(position);
+        // Make sure we don't have any leftover data from the previous setting
+        clearRecurrence();
 
         if (selection == DOES_NOT_REPEAT) {
             mRrule = null;