private void init() {
      if (mCursor != null) {
        mCursor.close();
      }

      String onlyStarredOfficeHoursSelection =
          "("
              + ScheduleContract.Blocks.BLOCK_TYPE
              + " != '"
              + ScheduleContract.Blocks.BLOCK_TYPE_OFFICE_HOURS
              + "' OR "
              + ScheduleContract.Blocks.NUM_STARRED_SESSIONS
              + ">0)";
      String excludeSandbox =
          "("
              + ScheduleContract.Blocks.BLOCK_TYPE
              + " != '"
              + ScheduleContract.Blocks.BLOCK_TYPE_SANDBOX
              + "')";
      mCursor =
          mContext
              .getContentResolver()
              .query(
                  ScheduleContract.Blocks.CONTENT_URI,
                  BlocksQuery.PROJECTION,
                  ScheduleContract.Blocks.BLOCK_END
                      + " >= ? AND "
                      + onlyStarredOfficeHoursSelection
                      + " AND "
                      + excludeSandbox,
                  new String[] {Long.toString(UIUtils.getCurrentTime(mContext))},
                  ScheduleContract.Blocks.DEFAULT_SORT);

      String displayTimeZone = PrefUtils.getDisplayTimeZone(mContext).getID();

      mSections = new ArrayList<SimpleSectionedListAdapter.Section>();
      mCursor.moveToFirst();
      long previousTime = -1;
      long time;
      mPMap = new SparseIntArray();
      mHeaderPositionMap = new SparseBooleanArray();
      int offset = 0;
      int globalPosition = 0;
      while (!mCursor.isAfterLast()) {
        time = mCursor.getLong(BlocksQuery.BLOCK_START);
        if (!UIUtils.isSameDayDisplay(previousTime, time, mContext)) {
          mBuffer.setLength(0);
          mSections.add(
              new SimpleSectionedListAdapter.Section(
                  mCursor.getPosition(),
                  DateUtils.formatDateRange(
                          mContext,
                          mFormatter,
                          time,
                          time,
                          DateUtils.FORMAT_ABBREV_MONTH
                              | DateUtils.FORMAT_SHOW_DATE
                              | DateUtils.FORMAT_SHOW_WEEKDAY,
                          displayTimeZone)
                      .toString()));
          ++offset;
          mHeaderPositionMap.put(globalPosition, true);
          mPMap.put(globalPosition, offset);
          ++globalPosition;
        }
        mHeaderPositionMap.put(globalPosition, false);
        mPMap.put(globalPosition, offset);
        ++globalPosition;
        previousTime = time;
        mCursor.moveToNext();
      }

      LOGV(TAG, "Leaving init()");
    }