Loading src/java/com/android/internal/telephony/CellBroadcastHandler.java +20 −2 Original line number Diff line number Diff line Loading @@ -30,15 +30,21 @@ import android.provider.Settings; import android.provider.Telephony; import android.telephony.SmsCbMessage; import android.telephony.SubscriptionManager; import android.util.LocalLog; import com.android.internal.telephony.metrics.TelephonyMetrics; import java.io.FileDescriptor; import java.io.PrintWriter; /** * Dispatch new Cell Broadcasts to receivers. Acquires a private wakelock until the broadcast * completes and our result receiver is called. */ public class CellBroadcastHandler extends WakeLockStateMachine { private final LocalLog mLocalLog = new LocalLog(100); private CellBroadcastHandler(Context context, Phone phone) { this("CellBroadcastHandler", context, phone); } Loading Loading @@ -90,9 +96,12 @@ public class CellBroadcastHandler extends WakeLockStateMachine { message.getMessagePriority(), message.isCmasMessage(), message.isEtwsMessage(), message.getServiceCategory()); String msg; Intent intent; if (message.isEmergencyMessage()) { log("Dispatching emergency SMS CB, SmsCbMessage is: " + message); msg = "Dispatching emergency SMS CB, SmsCbMessage is: " + message; log(msg); mLocalLog.log(msg); intent = new Intent(Telephony.Sms.Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION); // Explicitly send the intent to the default cell broadcast receiver. intent.setPackage(mContext.getResources().getString( Loading @@ -100,7 +109,9 @@ public class CellBroadcastHandler extends WakeLockStateMachine { receiverPermission = Manifest.permission.RECEIVE_EMERGENCY_BROADCAST; appOp = AppOpsManager.OP_RECEIVE_EMERGECY_SMS; } else { log("Dispatching SMS CB, SmsCbMessage is: " + message); msg = "Dispatching SMS CB, SmsCbMessage is: " + message; log(msg); mLocalLog.log(msg); intent = new Intent(Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION); // Send implicit intent since there are various 3rd party carrier apps listen to // this intent. Loading Loading @@ -129,4 +140,11 @@ public class CellBroadcastHandler extends WakeLockStateMachine { mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL, receiverPermission, appOp, mReceiver, getHandler(), Activity.RESULT_OK, null, null); } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("CellBroadcastHandler:"); mLocalLog.dump(fd, pw, args); pw.flush(); } } src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +51 −22 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.service.carrier.CarrierMessagingService; import android.telephony.Rlog; import android.telephony.SmsManager; import android.telephony.SmsMessage; import android.util.LocalLog; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -88,6 +89,8 @@ public class IccSmsInterfaceManager { final private UserManager mUserManager; protected SmsDispatchersController mDispatchersController; private final LocalLog mCellBroadcastLocalLog = new LocalLog(100); protected Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { Loading Loading @@ -790,7 +793,7 @@ public class IccSmsInterfaceManager { } else if (ranType == SmsManager.CELL_BROADCAST_RAN_TYPE_CDMA) { return enableCdmaBroadcastRange(startMessageId, endMessageId); } else { throw new IllegalArgumentException("Not a supportted RAN Type"); throw new IllegalArgumentException("Not a supported RAN Type"); } } Loading @@ -800,7 +803,7 @@ public class IccSmsInterfaceManager { } else if (ranType == SmsManager.CELL_BROADCAST_RAN_TYPE_CDMA) { return disableCdmaBroadcastRange(startMessageId, endMessageId); } else { throw new IllegalArgumentException("Not a supportted RAN Type"); throw new IllegalArgumentException("Not a supported RAN Type"); } } Loading @@ -813,15 +816,21 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCellBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) { log("Failed to add GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to add GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Added GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Added GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty()); Loading @@ -837,15 +846,21 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCellBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) { log("Failed to remove GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to remove GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Removed GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Removed GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty()); Loading @@ -861,15 +876,20 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCdmaBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) { log("Failed to add cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to add cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Added cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Added cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCdmaBroadcastActivation(!mCdmaBroadcastRangeManager.isEmpty()); Loading @@ -885,15 +905,20 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCdmaBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) { log("Failed to remove cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to remove cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Removed cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Removed cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCdmaBroadcastActivation(!mCdmaBroadcastRangeManager.isEmpty()); Loading Loading @@ -1338,6 +1363,10 @@ public class IccSmsInterfaceManager { } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("CellBroadcast log:"); mCellBroadcastLocalLog.dump(fd, pw, args); pw.println("SMS dispatcher controller log:"); mDispatchersController.dump(fd, pw, args); pw.flush(); } } src/java/com/android/internal/telephony/InboundSmsHandler.java +3 −0 Original line number Diff line number Diff line Loading @@ -1587,6 +1587,9 @@ public abstract class InboundSmsHandler extends StateMachine { @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { super.dump(fd, pw, args); if (mCellBroadcastHandler != null) { mCellBroadcastHandler.dump(fd, pw, args); } mLocalLog.dump(fd, pw, args); } Loading Loading
src/java/com/android/internal/telephony/CellBroadcastHandler.java +20 −2 Original line number Diff line number Diff line Loading @@ -30,15 +30,21 @@ import android.provider.Settings; import android.provider.Telephony; import android.telephony.SmsCbMessage; import android.telephony.SubscriptionManager; import android.util.LocalLog; import com.android.internal.telephony.metrics.TelephonyMetrics; import java.io.FileDescriptor; import java.io.PrintWriter; /** * Dispatch new Cell Broadcasts to receivers. Acquires a private wakelock until the broadcast * completes and our result receiver is called. */ public class CellBroadcastHandler extends WakeLockStateMachine { private final LocalLog mLocalLog = new LocalLog(100); private CellBroadcastHandler(Context context, Phone phone) { this("CellBroadcastHandler", context, phone); } Loading Loading @@ -90,9 +96,12 @@ public class CellBroadcastHandler extends WakeLockStateMachine { message.getMessagePriority(), message.isCmasMessage(), message.isEtwsMessage(), message.getServiceCategory()); String msg; Intent intent; if (message.isEmergencyMessage()) { log("Dispatching emergency SMS CB, SmsCbMessage is: " + message); msg = "Dispatching emergency SMS CB, SmsCbMessage is: " + message; log(msg); mLocalLog.log(msg); intent = new Intent(Telephony.Sms.Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION); // Explicitly send the intent to the default cell broadcast receiver. intent.setPackage(mContext.getResources().getString( Loading @@ -100,7 +109,9 @@ public class CellBroadcastHandler extends WakeLockStateMachine { receiverPermission = Manifest.permission.RECEIVE_EMERGENCY_BROADCAST; appOp = AppOpsManager.OP_RECEIVE_EMERGECY_SMS; } else { log("Dispatching SMS CB, SmsCbMessage is: " + message); msg = "Dispatching SMS CB, SmsCbMessage is: " + message; log(msg); mLocalLog.log(msg); intent = new Intent(Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION); // Send implicit intent since there are various 3rd party carrier apps listen to // this intent. Loading Loading @@ -129,4 +140,11 @@ public class CellBroadcastHandler extends WakeLockStateMachine { mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL, receiverPermission, appOp, mReceiver, getHandler(), Activity.RESULT_OK, null, null); } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("CellBroadcastHandler:"); mLocalLog.dump(fd, pw, args); pw.flush(); } }
src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +51 −22 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.service.carrier.CarrierMessagingService; import android.telephony.Rlog; import android.telephony.SmsManager; import android.telephony.SmsMessage; import android.util.LocalLog; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -88,6 +89,8 @@ public class IccSmsInterfaceManager { final private UserManager mUserManager; protected SmsDispatchersController mDispatchersController; private final LocalLog mCellBroadcastLocalLog = new LocalLog(100); protected Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { Loading Loading @@ -790,7 +793,7 @@ public class IccSmsInterfaceManager { } else if (ranType == SmsManager.CELL_BROADCAST_RAN_TYPE_CDMA) { return enableCdmaBroadcastRange(startMessageId, endMessageId); } else { throw new IllegalArgumentException("Not a supportted RAN Type"); throw new IllegalArgumentException("Not a supported RAN Type"); } } Loading @@ -800,7 +803,7 @@ public class IccSmsInterfaceManager { } else if (ranType == SmsManager.CELL_BROADCAST_RAN_TYPE_CDMA) { return disableCdmaBroadcastRange(startMessageId, endMessageId); } else { throw new IllegalArgumentException("Not a supportted RAN Type"); throw new IllegalArgumentException("Not a supported RAN Type"); } } Loading @@ -813,15 +816,21 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCellBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) { log("Failed to add GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to add GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Added GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Added GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty()); Loading @@ -837,15 +846,21 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCellBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) { log("Failed to remove GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to remove GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Removed GSM cell broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Removed GSM cell broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCellBroadcastActivation(!mCellBroadcastRangeManager.isEmpty()); Loading @@ -861,15 +876,20 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCdmaBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) { log("Failed to add cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to add cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Added cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Added cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCdmaBroadcastActivation(!mCdmaBroadcastRangeManager.isEmpty()); Loading @@ -885,15 +905,20 @@ public class IccSmsInterfaceManager { String client = mContext.getPackageManager().getNameForUid( Binder.getCallingUid()); String msg; if (!mCdmaBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) { log("Failed to remove cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); msg = "Failed to remove cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); return false; } if (DBG) log("Removed cdma broadcast subscription for MID range " + startMessageId + " to " + endMessageId + " from client " + client); if (DBG) { msg = "Removed cdma broadcast channels range " + startMessageId + " to " + endMessageId; log(msg); mCellBroadcastLocalLog.log(msg); } setCdmaBroadcastActivation(!mCdmaBroadcastRangeManager.isEmpty()); Loading Loading @@ -1338,6 +1363,10 @@ public class IccSmsInterfaceManager { } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("CellBroadcast log:"); mCellBroadcastLocalLog.dump(fd, pw, args); pw.println("SMS dispatcher controller log:"); mDispatchersController.dump(fd, pw, args); pw.flush(); } }
src/java/com/android/internal/telephony/InboundSmsHandler.java +3 −0 Original line number Diff line number Diff line Loading @@ -1587,6 +1587,9 @@ public abstract class InboundSmsHandler extends StateMachine { @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { super.dump(fd, pw, args); if (mCellBroadcastHandler != null) { mCellBroadcastHandler.dump(fd, pw, args); } mLocalLog.dump(fd, pw, args); } Loading