FileDocCategorySizeDatePackage
CellBroadcastHandler.javaAPI DocAndroid 5.1 API3735Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony

CellBroadcastHandler

public class CellBroadcastHandler extends WakeLockStateMachine
Dispatch new Cell Broadcasts to receivers. Acquires a private wakelock until the broadcast completes and our result receiver is called.

Fields Summary
Constructors Summary
private CellBroadcastHandler(android.content.Context context, PhoneBase phone)

        this("CellBroadcastHandler", context, phone);
    
protected CellBroadcastHandler(String debugTag, android.content.Context context, PhoneBase phone)

        super(debugTag, context, phone);
    
Methods Summary
protected voidhandleBroadcastSms(android.telephony.SmsCbMessage message)
Dispatch a Cell Broadcast message to listeners.

param
message the Cell Broadcast to broadcast

        String receiverPermission;
        int appOp;

        Intent intent;
        if (message.isEmergencyMessage()) {
            log("Dispatching emergency SMS CB, SmsCbMessage is: " + message);
            intent = new Intent(Telephony.Sms.Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
            receiverPermission = Manifest.permission.RECEIVE_EMERGENCY_BROADCAST;
            appOp = AppOpsManager.OP_RECEIVE_EMERGECY_SMS;
        } else {
            log("Dispatching SMS CB, SmsCbMessage is: " + message);
            intent = new Intent(Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION);
            receiverPermission = Manifest.permission.RECEIVE_SMS;
            appOp = AppOpsManager.OP_RECEIVE_SMS;
        }
        intent.putExtra("message", message);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, mPhone.getPhoneId());
        mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL, receiverPermission, appOp,
                mReceiver, getHandler(), Activity.RESULT_OK, null, null);
    
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 SmsCbMessage) {
            handleBroadcastSms((SmsCbMessage) message.obj);
            return true;
        } else {
            loge("handleMessage got object of type: " + message.obj.getClass().getName());
            return false;
        }
    
public static com.android.internal.telephony.CellBroadcastHandlermakeCellBroadcastHandler(android.content.Context context, PhoneBase phone)
Create a new CellBroadcastHandler.

param
context the context to use for dispatching Intents
return
the new handler

        CellBroadcastHandler handler = new CellBroadcastHandler(context, phone);
        handler.start();
        return handler;