Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af31bedd authored by Stephen Bird's avatar Stephen Bird Committed by Jochen Sprickerhof
Browse files

prepareForSave: Dont set time in allday events

Change-Id: I0e887b9e4fb6f36b8dd0d452cbcac0c175d93bdc
parent 3951dea3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -536,7 +536,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() {
@@ -633,7 +633,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;
        }
@@ -685,7 +685,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;
@@ -699,6 +699,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 =
@@ -1147,7 +1148,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();