public void decreaseRemainingParts(Envelope.SubParts aType) {
    --mRemainingParts[aType.ordinal()];

    if (mRemainingParts[SubParts.SENT_PART.ordinal()]
        > mRemainingParts[SubParts.DELIVERED_PART.ordinal()]) {
      Log.e("GeckoSmsManager", "Delivered more parts than we sent!?");
    }
  }
  public Envelope(int aId, int aParts) {
    mId = aId;
    mMessageId = -1;
    mError = GeckoSmsManager.kNoError;

    int size = Envelope.SubParts.values().length;
    mRemainingParts = new int[size];
    mFailing = new boolean[size];

    for (int i = 0; i < size; ++i) {
      mRemainingParts[i] = aParts;
      mFailing[i] = false;
    }
  }
 public void markAsFailed(Envelope.SubParts aType) {
   mFailing[aType.ordinal()] = true;
 }
 public boolean arePartsRemaining(Envelope.SubParts aType) {
   return mRemainingParts[aType.ordinal()] != 0;
 }
 public boolean isFailing(Envelope.SubParts aType) {
   return mFailing[aType.ordinal()];
 }