refactor: remove deprecated RECEIVED_DATA broadcast

This commit is contained in:
andrekir 2024-01-10 12:24:18 -03:00
parent dcb19da723
commit ed649470f9
3 changed files with 1 additions and 16 deletions

View file

@ -33,17 +33,12 @@ Once you have bound to the service you should register your broadcast receivers
// com.geeksville.mesh.x broadcast intents, where x is:
// RECEIVED_DATA for data received from other nodes. payload will contain a DataPacket, this action is DEPRECATED (because it sends all received data)
// far better to instead use RECEIVED.<portnumm>
// RECEIVED.<portnumm> - will **only** deliver packets for the specified port number. If a wellknown portnums.proto name for portnum is known it will be used
// (i.e. com.geeksville.mesh.RECEIVED.TEXT_MESSAGE_APP) else the numeric portnum will be included as a base 10 integer (com.geeksville.mesh.RECEIVED.4403 etc...)
// NODE_CHANGE for new IDs appearing or disappearing
// CONNECTION_CHANGED for losing/gaining connection to the packet radio
// MESSAGE_STATUS_CHANGED for any message status changes (for sent messages only, other messages come via RECEIVED_DATA. payload will contain a message ID and a MessageStatus)
At the very least you will probably want to receive RECEIVED_DATA.
// MESSAGE_STATUS_CHANGED for any message status changes (for sent messages only, payload will contain a message ID and a MessageStatus)
Note - these calls might throw RemoteException to indicate mesh error states
*/

View file

@ -85,9 +85,6 @@ class MeshService : Service(), Logging {
/// Intents broadcast by MeshService
/* @Deprecated(message = "Does not filter by port number. For legacy reasons only broadcast for UNKNOWN_APP, switch to ACTION_RECEIVED")
const val ACTION_RECEIVED_DATA = "$prefix.RECEIVED_DATA" */
private fun actionReceived(portNum: String) = "$prefix.RECEIVED.$portNum"
/// generate a RECEIVED action filter string that includes either the portnumber as an int, or preferably a symbolic name from portnums.proto

View file

@ -24,13 +24,6 @@ class MeshServiceBroadcasts(
payload
)
)
/*
// For the time being we ALSO broadcast using old ACTION_RECEIVED_DATA field for any oldschool opaque packets
// newer packets (that have a non zero portnum) are only broadcast using the standard mechanism.
if(payload.dataType == Portnums.PortNum.UNKNOWN_APP_VALUE)
explicitBroadcast(Intent(MeshService.ACTION_RECEIVED_DATA).putExtra(EXTRA_PAYLOAD, payload))
*/
}
fun broadcastNodeChange(info: NodeInfo) {