diff options
author | Stephen Bird <sbird@cyngn.com> | 2015-07-16 17:58:38 -0700 |
---|---|---|
committer | Stephen Bird <sbird@cyngn.com> | 2015-07-23 18:18:39 -0700 |
commit | d2b19c1c89a1fc6d2de39639d683d8f72b4b7627 (patch) | |
tree | 53a8dc7085a3210a29be2c74070ce92e7e26b227 | |
parent | 38c960cefc5b221c8b6bfd0ecceec2028484af70 (diff) | |
download | android_packages_apps_Calendar-caf/cm-12.1.tar.gz android_packages_apps_Calendar-caf/cm-12.1.tar.bz2 android_packages_apps_Calendar-caf/cm-12.1.zip |
prepareForSave: Dont set time in allday eventscaf/cm-12.1
Change-Id: I0e887b9e4fb6f36b8dd0d452cbcac0c175d93bdc
(cherry picked from commit ab02bbdf98f16419af59cd8d9b7ce3e757449c54)
(cherry picked from commit aef1556641bc2d9b7d4ec3bf02508c28a070be73)
-rw-r--r-- | src/com/android/calendar/event/EditEventView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/calendar/event/EditEventView.java b/src/com/android/calendar/event/EditEventView.java index 98402da4..6a14fe78 100644 --- a/src/com/android/calendar/event/EditEventView.java +++ b/src/com/android/calendar/event/EditEventView.java @@ -576,7 +576,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa if (mModel == null || (mCalendarsCursor == null && mModel.mUri == null)) { return false; } - return fillModelFromUI(); + return fillModelFromUI(true); } public boolean fillModelFromReadOnlyUi() { @@ -673,7 +673,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa } // Goes through the UI elements and updates the model as necessary - private boolean fillModelFromUI() { + private boolean fillModelFromUI(boolean ignoreAllday) { if (mModel == null) { return false; } @@ -722,7 +722,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa } } - if (mModel.mAllDay) { + if (mModel.mAllDay && !ignoreAllday) { // Reset start and end time, increment the monthDay by 1, and set // the timezone to UTC, as required for all-day events. mTimezone = Time.TIMEZONE_UTC; @@ -736,6 +736,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa mEndTime.minute = 0; mEndTime.second = 0; mEndTime.timezone = mTimezone; + mModel.mEnd = mEndTime.normalize(true); // When a user see the event duration as "X - Y" (e.g. Oct. 28 - Oct. 29), end time // should be Y + 1 (Oct.30). final long normalizedEndTimeMillis = @@ -1381,7 +1382,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa if (mSaveAfterQueryComplete) { mLoadingCalendarsDialog.cancel(); - if (prepareForSave() && fillModelFromUI()) { + if (prepareForSave() && fillModelFromUI(false)) { int exit = userVisible ? Utils.DONE_EXIT : 0; mDone.setDoneCode(Utils.DONE_SAVE | exit); mDone.run(); |