diff options
author | Isaac Katzenelson <isaackatz@google.com> | 2013-05-13 23:40:39 -0700 |
---|---|---|
committer | Isaac Katzenelson <isaackatz@google.com> | 2013-05-13 23:48:06 -0700 |
commit | b4f28b8e72f63e48102a6688ff5576e02c14069e (patch) | |
tree | 1e76e3fe337a1b06cb23918460218017a8b6aa53 | |
parent | f126f4bb6224637a5486b2a90f4b4877e68c8385 (diff) | |
download | Calendar-b4f28b8e72f63e48102a6688ff5576e02c14069e.tar.gz |
Query for Colors in parallel with all other queries
Bug: 8945406
When the data queried for editing an event is not done squentially
there is a timing issue that causes the view to lose the focus and
the IME. Changed the queries to start all in parallel.
Change-Id: Id592d7f1ae0f27717275288a661d5938c0a4f485
-rw-r--r-- | src/com/android/calendar/event/EditEventFragment.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/calendar/event/EditEventFragment.java b/src/com/android/calendar/event/EditEventFragment.java index 6b350b03..e1d59f8e 100644 --- a/src/com/android/calendar/event/EditEventFragment.java +++ b/src/com/android/calendar/event/EditEventFragment.java @@ -246,6 +246,11 @@ public class EditEventFragment extends Fragment implements EventHandler, OnColor EditEventHelper.CALENDARS_PROJECTION, EditEventHelper.CALENDARS_WHERE, selArgs /* selection args */, null /* sort order */); + // TOKEN_COLORS + mHandler.startQuery(TOKEN_COLORS, null, Colors.CONTENT_URI, + EditEventHelper.COLORS_PROJECTION, + Colors.COLOR_TYPE + "=" + Colors.TYPE_EVENT, null, null); + setModelIfDone(TOKEN_EVENT); break; case TOKEN_ATTENDEES: @@ -335,9 +340,6 @@ public class EditEventFragment extends Fragment implements EventHandler, OnColor EditEventHelper.setModelFromCalendarCursor(mModel, cursor); EditEventHelper.setModelFromCalendarCursor(mOriginalModel, cursor); } - startQuery(TOKEN_COLORS, null, Colors.CONTENT_URI, - EditEventHelper.COLORS_PROJECTION, - Colors.COLOR_TYPE + "=" + Colors.TYPE_EVENT, null, null); } finally { cursor.close(); } @@ -525,12 +527,16 @@ public class EditEventFragment extends Fragment implements EventHandler, OnColor mModel.mCalendarId = mCalendarId; mModel.mSelfAttendeeStatus = Attendees.ATTENDEE_STATUS_ACCEPTED; - // Start a query in the background to read the list of calendars + // Start a query in the background to read the list of calendars and colors mHandler.startQuery(TOKEN_CALENDARS, null, Calendars.CONTENT_URI, EditEventHelper.CALENDARS_PROJECTION, EditEventHelper.CALENDARS_WHERE_WRITEABLE_VISIBLE, null /* selection args */, null /* sort order */); + mHandler.startQuery(TOKEN_COLORS, null, Colors.CONTENT_URI, + EditEventHelper.COLORS_PROJECTION, + Colors.COLOR_TYPE + "=" + Colors.TYPE_EVENT, null, null); + mModification = Utils.MODIFY_ALL; mView.setModification(mModification); } |