I am registering a BroadcastReceiver
to listen for intents from the Zebra Technologies Datawedge built in App. Everything is working perfectly.
I want to explicitly listen if the device on which the App is installed, has the active datawedge App. This is done via the status notification intent which will return nothing: giving an indication of no datawedge service is available.
The problem is that the logcat on a normal Nokia 6.3 phone that does not have the datawedge App installed only silently gives the below error. The problem is that it is silent, no App crash and I am not sure if it will be silent for all types of devices. The documentation does not say on whether a failed broadcast will cause a meltdown or a silent sputtering out. This answer only talks about broadcasts with no receivers from a memory perspective.
My question is will the
sendBroadcast
method always give silent errors or will it cause an App to crash on some devices?
... E/awedgezebrates: Unknown bits set in runtime_flags: 0x8000
... I/Perf: Connecting to perf service.
... E/Perf: Fail to get file list com.domain.datawedgezebratest
... E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
... E/Perf: Fail to get file list com.domain.datawedgezebratest
... E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
Below is how the Broadcast receiver is registered:
// Register broadcast receiver to listen for responses from datawedge API
val intentFilter = IntentFilter()
intentFilter.addAction("com.symbol.datawedge.api.NOTIFICATION_ACTION")
registerReceiver(receiver, intentFilter) // receiver is a activity scope variable referencing a class that inherited the android.content.BroadcastReceiver instance
val b = Bundle()
b.putString("com.symbol.datawedge.api.APPLICATION_NAME", "com.domain.datawedgezebratest")
b.putString("com.symbol.datawedge.api.NOTIFICATION_TYPE", "SCANNER_STATUS")
val i = Intent()
i.action = DwInterface.DATAWEDGE_SEND_ACTION
i.putExtra("com.symbol.datawedge.api.REGISTER_FOR_NOTIFICATION", b)
this.sendBroadcast(i)