summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2015-07-16 17:58:38 -0700
committerStephen Bird <sbird@cyngn.com>2015-07-23 18:18:29 -0700
commitaef1556641bc2d9b7d4ec3bf02508c28a070be73 (patch)
treec83f91972587a0a63d1ec99cfc6430f8dde4dc88
parent20104525f22b8ab13dc9ff556537d7e4773f338c (diff)
downloadandroid_packages_apps_Calendar-caf/cm-12.0.tar.gz
android_packages_apps_Calendar-caf/cm-12.0.tar.bz2
android_packages_apps_Calendar-caf/cm-12.0.zip
prepareForSave: Dont set time in allday eventscaf/cm-12.0
Change-Id: I0e887b9e4fb6f36b8dd0d452cbcac0c175d93bdc (cherry picked from commit ab02bbdf98f16419af59cd8d9b7ce3e757449c54)
-rw-r--r--src/com/android/calendar/event/EditEventView.java9
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();