FileDocCategorySizeDatePackage
CdmaServiceCategoryProgramHandler.javaAPI DocAndroid 5.1 API7686Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.cdma

CdmaServiceCategoryProgramHandler

public final class CdmaServiceCategoryProgramHandler extends com.android.internal.telephony.WakeLockStateMachine
Handle CDMA Service Category Program Data requests and responses.

Fields Summary
final com.android.internal.telephony.CommandsInterface
mCi
private final android.content.BroadcastReceiver
mScpResultsReceiver
Broadcast receiver to handle results of ordered broadcast. Sends the SCPD results as a reply SMS, then sends a message to state machine to transition to idle.
Constructors Summary
CdmaServiceCategoryProgramHandler(android.content.Context context, com.android.internal.telephony.CommandsInterface commandsInterface)
Create a new CDMA inbound SMS handler.

        super("CdmaServiceCategoryProgramHandler", context, null);
        mContext = context;
        mCi = commandsInterface;
    
Methods Summary
private booleanhandleServiceCategoryProgramData(SmsMessage sms)
Send SCPD request to CellBroadcastReceiver as an ordered broadcast.

param
sms the CDMA SmsMessage containing the SCPD request
return
true if an ordered broadcast was sent; false on failure

        ArrayList<CdmaSmsCbProgramData> programDataList = sms.getSmsCbProgramData();
        if (programDataList == null) {
            loge("handleServiceCategoryProgramData: program data list is null!");
            return false;
        }

        Intent intent = new Intent(Intents.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION);
        intent.putExtra("sender", sms.getOriginatingAddress());
        intent.putParcelableArrayListExtra("program_data", programDataList);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, mPhone.getPhoneId());
        mContext.sendOrderedBroadcast(intent, Manifest.permission.RECEIVE_SMS,
                AppOpsManager.OP_RECEIVE_SMS, mScpResultsReceiver,
                getHandler(), Activity.RESULT_OK, null, null);
        return true;
    
protected booleanhandleSmsMessage(android.os.Message message)
Handle Cell Broadcast messages from {@code CdmaInboundSmsHandler}. 3GPP-format Cell Broadcast messages sent from radio are handled in the subclass.

param
message the message to process
return
true if an ordered broadcast was sent; false on failure

        if (message.obj instanceof SmsMessage) {
            return handleServiceCategoryProgramData((SmsMessage) message.obj);
        } else {
            loge("handleMessage got object of type: " + message.obj.getClass().getName());
            return false;
        }
    
static com.android.internal.telephony.cdma.CdmaServiceCategoryProgramHandlermakeScpHandler(android.content.Context context, com.android.internal.telephony.CommandsInterface commandsInterface)
Create a new State machine for SCPD requests.

param
context the context to use
param
commandsInterface the radio commands interface
return
the new SCPD handler

        CdmaServiceCategoryProgramHandler handler = new CdmaServiceCategoryProgramHandler(
                context, commandsInterface);
        handler.start();
        return handler;