CellBroadcastHandlerpublic class CellBroadcastHandler extends WakeLockStateMachine Dispatch new Cell Broadcasts to receivers. Acquires a private wakelock until the broadcast
completes and our result receiver is called. |
Methods Summary |
---|
protected void | handleBroadcastSms(android.telephony.SmsCbMessage message)Dispatch a Cell Broadcast message to listeners.
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 boolean | handleSmsMessage(android.os.Message message)Handle Cell Broadcast messages from {@code CdmaInboundSmsHandler}.
3GPP-format Cell Broadcast messages sent from radio are handled in the subclass.
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.CellBroadcastHandler | makeCellBroadcastHandler(android.content.Context context, PhoneBase phone)Create a new CellBroadcastHandler.
CellBroadcastHandler handler = new CellBroadcastHandler(context, phone);
handler.start();
return handler;
|
|