FileDocCategorySizeDatePackage
ReadRecTransaction.javaAPI DocAndroid 1.5 API3601Wed May 06 22:42:46 BST 2009com.android.mms.transaction

ReadRecTransaction

public class ReadRecTransaction extends Transaction
The ReadRecTransaction is responsible for sending read report notifications (M-read-rec.ind) to clients that have requested them. It:
  • Loads the read report indication from storage (Outbox).
  • Packs M-read-rec.ind and sends it.
  • Notifies the TransactionService about succesful completion.

Fields Summary
private static final String
TAG
private static final boolean
DEBUG
private static final boolean
LOCAL_LOGV
private final android.net.Uri
mReadReportURI
Constructors Summary
public ReadRecTransaction(android.content.Context context, int transId, TransactionSettings connectionSettings, String uri)


      
             
             
              
        super(context, transId, connectionSettings);
        mReadReportURI = Uri.parse(uri);
        mId = uri;

        // Attach the transaction to the instance of RetryScheduler.
        attach(RetryScheduler.getInstance(context));
    
Methods Summary
public intgetType()

        return READREC_TRANSACTION;
    
public voidprocess()

        PduPersister persister = PduPersister.getPduPersister(mContext);

        try {
            // Load M-read-rec.ind from outbox
            ReadRecInd readRecInd = (ReadRecInd) persister.load(mReadReportURI);

            // Pack M-read-rec.ind and send it
            byte[] postingData = new PduComposer(mContext, readRecInd).make();
            sendPdu(postingData);

            Uri uri = persister.move(mReadReportURI, Sent.CONTENT_URI);
            mTransactionState.setState(TransactionState.SUCCESS);
            mTransactionState.setContentUri(uri);
        } catch (IOException e) {
            if (LOCAL_LOGV) {
                Log.v(TAG, "Failed to send M-Read-Rec.Ind.", e);
            }
        } catch (MmsException e) {
            if (LOCAL_LOGV) {
                Log.v(TAG, "Failed to load message from Outbox.", e);
            }
        } catch (RuntimeException e) {
            if (LOCAL_LOGV) {
                Log.e(TAG, "Unexpected RuntimeException.", e);
            }
        } finally {
            if (mTransactionState.getState() != TransactionState.SUCCESS) {
                mTransactionState.setState(TransactionState.FAILED);
                mTransactionState.setContentUri(mReadReportURI);
            }
            notifyObservers();
        }