Beispiel #1
0
  @Override
  public void delete(
      OperationContext octxt, int[] itemIds, MailItem.Type type, TargetConstraint tcon)
      throws ServiceException {
    lock.lock();
    try {
      mLocalTagDeletes.clear();

      for (int id : itemIds) {
        try {
          if (id != ID_AUTO_INCREMENT) {
            getTagById(octxt, id);
            if ((getChangeMask(octxt, id, MailItem.Type.TAG) & Change.CONFLICT) != 0) {
              mLocalTagDeletes.add(id);
            }
          }
        } catch (NoSuchItemException e) {
        }

        try {
          // NOTE: don't call the one with single id as it will dead loop
          super.delete(octxt, new int[] {id}, type, tcon);
        } catch (Exception x) {
          SyncExceptionHandler.localDeleteFailed(this, id, x);
          // something is wrong, but we'll just skip since failed deleting a local item is not
          // immediately
          // fatal (not too good either)
        }
      }
    } finally {
      lock.release();
    }
  }