public class

TransactionService

extends Service
implements Observer
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ com.android.mms.transaction.TransactionService

Class Overview

The TransactionService of the MMS Client is responsible for handling requests to initiate client-transactions sent from:

  • The Proxy-Relay (Through Push messages)
  • The composer/viewer activities of the MMS Client (Through intents)
The TransactionService runs locally in the same process as the application. It contains a HandlerThread to which messages are posted from the intent-receivers of this application.

IMPORTANT: This is currently the only instance in the system in which simultaneous connectivity to both the mobile data network and a Wi-Fi network is allowed. This makes the code for handling network connectivity somewhat different than it is in other applications. In particular, we want to be able to send or receive MMS messages when a Wi-Fi connection is active (which implies that there is no connection to the mobile data network). This has two main consequences:

  • Testing for current network connectivity (isConnected() is not sufficient. Instead, the correct test is for network availability (isAvailable()).
  • If the mobile data network is not in the connected state, but it is available, we must initiate setup of the mobile data connection, and defer handling the MMS transaction until the connection is established.

Summary

Constants
String ACTION_ONALARM Action for the Intent which is sent by Alarm service to launch TransactionService.
String STATE Used as extra key in notification intents broadcasted by the TransactionService when a Transaction is completed (TRANSACTION_COMPLETED_ACTION intents).
String STATE_URI Used as extra key in notification intents broadcasted by the TransactionService when a Transaction is completed (TRANSACTION_COMPLETED_ACTION intents).
String TRANSACTION_COMPLETED_ACTION Used to identify notification intents broadcasted by the TransactionService when a Transaction is completed.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Fields
public Handler mToastHandler
Public Constructors
TransactionService()
Public Methods
IBinder onBind(Intent intent)
void onCreate()
void onDestroy()
int onStartCommand(Intent intent, int flags, int startId)
void update(Observable observable)
Handle status change of Transaction (The Observable).
Protected Methods
int beginMmsConnectivity()
void endMmsConnectivity()
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface com.android.mms.transaction.Observer

Constants

public static final String ACTION_ONALARM

Action for the Intent which is sent by Alarm service to launch TransactionService.

Constant Value: "android.intent.action.ACTION_ONALARM"

public static final String STATE

Used as extra key in notification intents broadcasted by the TransactionService when a Transaction is completed (TRANSACTION_COMPLETED_ACTION intents). Allowed values for this key are: TransactionState.INITIALIZED, TransactionState.SUCCESS, TransactionState.FAILED.

Constant Value: "state"

public static final String STATE_URI

Used as extra key in notification intents broadcasted by the TransactionService when a Transaction is completed (TRANSACTION_COMPLETED_ACTION intents). Allowed values for this key are any valid content uri.

Constant Value: "uri"

public static final String TRANSACTION_COMPLETED_ACTION

Used to identify notification intents broadcasted by the TransactionService when a Transaction is completed.

Constant Value: "android.intent.action.TRANSACTION_COMPLETED_ACTION"

Fields

public Handler mToastHandler

Public Constructors

public TransactionService ()

Public Methods

public IBinder onBind (Intent intent)

public void onCreate ()

public void onDestroy ()

public int onStartCommand (Intent intent, int flags, int startId)

public void update (Observable observable)

Handle status change of Transaction (The Observable).

Parameters
observable An observable object.

Protected Methods

protected int beginMmsConnectivity ()

Throws
IOException

protected void endMmsConnectivity ()