예제 #1
0
  @Override
  /**
   * Describe <code>getCount</code> method here.
   *
   * @return an <code>int</code> value
   */
  public int getCount() {
    int count = 0;
    for (Cursor cur : mSmsCursorArray) {
      if (cur != null && !cur.isClosed() && cur.getCount() > 0) {
        count += cur.getCount();
      }
    }

    MyLogger.logD(CLASS_TAG, "getCount():" + count);
    return count;
  }
예제 #2
0
  @Override
  /**
   * Describe <code>isAfterLast</code> method here.
   *
   * @return a <code>boolean</code> value
   */
  public boolean isAfterLast() {
    boolean result = true;
    for (Cursor cur : mSmsCursorArray) {
      if (cur != null && !cur.isAfterLast()) {
        result = false;
        break;
      }
    }

    MyLogger.logD(CLASS_TAG, "isAfterLast():" + result);
    return result;
  }
예제 #3
0
  /** Describe <code>onEnd</code> method here. */
  public final void onEnd() {
    super.onEnd();
    try {
      MyLogger.logD(CLASS_TAG, "SmsBackupComposer onEnd");
      if (mWriter != null) {
        MyLogger.logE(CLASS_TAG, "mWriter.close()");
        mWriter.close();
      }
    } catch (Exception e) {
      MyLogger.logE(CLASS_TAG, "mWriter.close() failed");
    }

    for (Cursor cur : mSmsCursorArray) {
      if (cur != null) {
        cur.close();
        cur = null;
      }
    }
  }
예제 #4
0
  @Override
  /**
   * Describe <code>init</code> method here.
   *
   * @return a <code>boolean</code> value
   */
  public boolean init() {
    boolean result = false;
    for (int i = 0; i < mSmsUriArray.length; ++i) {
      mSmsCursorArray[i] =
          mContext.getContentResolver().query(mSmsUriArray[i], null, null, null, "date ASC");
      if (mSmsCursorArray[i] != null) {
        mSmsCursorArray[i].moveToFirst();
        result = true;
      }
    }

    MyLogger.logD(CLASS_TAG, "init():" + result + ",count:" + getCount());
    return result;
  }