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

MmsSystemEventReceiver

public class MmsSystemEventReceiver extends android.content.BroadcastReceiver
MmsSystemEventReceiver receives the {@link android.content.intent.ACTION_BOOT_COMPLETED}, {@link com.android.internal.telephony.TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED} and performs a series of operations which may include:
  • Show/hide the icon in notification area which is used to indicate whether there is new incoming message.
  • Resend the MM's in the outbox.

Fields Summary
private static final String
TAG
Constructors Summary
Methods Summary
public voidonReceive(android.content.Context context, android.content.Intent intent)

        if (Log.isLoggable(MmsApp.LOG_TAG, Log.VERBOSE)) {
            Log.v(TAG, "Intent received: " + intent);
        }

        String action = intent.getAction();
        if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) {
            Uri changed = (Uri) intent.getParcelableExtra(Mms.Intents.DELETED_CONTENTS);
            PduCache.getInstance().purge(changed);
        } else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
            String state = intent.getStringExtra(Phone.STATE_KEY);

            if (Log.isLoggable(MmsApp.LOG_TAG, Log.VERBOSE)) {
                Log.v(TAG, "ANY_DATA_STATE event received: " + state);
            }

            if (state.equals("CONNECTED")) {
                wakeUpService(context);
            }
        } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
            // We should check whether there are unread incoming
            // messages in the Inbox and then update the notification icon.
            MessagingNotification.updateNewMessageIndicator(context);
        }
    
private static voidwakeUpService(android.content.Context context)


         
        if (Log.isLoggable(MmsApp.LOG_TAG, Log.VERBOSE)) {
            Log.v(TAG, "wakeUpService: start transaction service ...");
        }

        context.startService(new Intent(context, TransactionService.class));