Home | History | Annotate | Download | only in transaction
      1 /*
      2 * Copyright (C) 2013 Samsung System LSI
      3 * Licensed under the Apache License, Version 2.0 (the "License");
      4 * you may not use this file except in compliance with the License.
      5 * You may obtain a copy of the License at
      6 *
      7 *      http://www.apache.org/licenses/LICENSE-2.0
      8 *
      9 * Unless required by applicable law or agreed to in writing, software
     10 * distributed under the License is distributed on an "AS IS" BASIS,
     11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 * See the License for the specific language governing permissions and
     13 * limitations under the License.
     14 */
     15 package com.android.mms.transaction;
     16 
     17 import com.android.mms.LogTag;
     18 
     19 import android.content.BroadcastReceiver;
     20 import android.content.Context;
     21 import android.content.Intent;
     22 import android.util.Log;
     23 
     24 /**
     25  * MmsPushOutboxMessages listens for MMS_SEND_OUTBOX_MSG intent .
     26  * {@link android.intent.action.MMS_SEND_OUTBOX_MSG},
     27  * and wakes up the mms service when it receives it.
     28  * This will tricker the mms service to send any messages stored
     29  * in the outbox.
     30  */
     31 public class MmsPushOutboxMessages extends BroadcastReceiver {
     32     private static final String INTENT_MMS_SEND_OUTBOX_MSG = "android.intent.action.MMS_SEND_OUTBOX_MSG";
     33     private static final String TAG = LogTag.TAG;
     34 
     35     @Override
     36     public void onReceive(Context context, Intent intent) {
     37         if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
     38             Log.v(TAG, "Received the MMS_SEND_OUTBOX_MSG intent: " + intent);
     39         }
     40         String action = intent.getAction();
     41         if(action.equalsIgnoreCase(INTENT_MMS_SEND_OUTBOX_MSG)){
     42             Log.d(TAG,"Now waking up the MMS service");
     43             context.startService(new Intent(context, TransactionService.class));
     44         }
     45     }
     46 
     47 }
     48