Hello.
I’m trying to get a Memor 12 scan result using Intent Wedge.
I enabled the Intent Wedge and added a custom Intent action settings.
When I scan, logcat reveal this exception:
Sending non-protected broadcast com.myapp.ACTION from system 7218:com.datalogic.service/1000 pkg com.datalogic.service (Ask Gemini)
java.lang.Throwable
at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:13824)
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:14546)
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:13842)
at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:14720)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2296)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2658)
at android.os.Binder.execTransactInternal(Binder.java:1280)
at android.os.Binder.execTransact(Binder.java:1244)
I’m using a runtime BroadcastReceiver with the correct IntentFilter.
The message you are seeing in logcat is because we are sending a broadcast without defining a required permission. This is not an error but a warning, intended to inform the developers of com.datalogic.service that they should restrict their broadcast with a permission. To maximize compatibility, we do not intend to change intent wedge to use a protected broadcast. So, as a result of this decision, you will continue to see these messages in logcat.
However, the most likely cause of your issue is to do with the category of the intent. There are two ways you can ensure the category of your broadcast is set correctly.
Or include the category in your intent filter, the default of which is com.datalogic.decodewedge.decode_category
I will also say, it looks like you have changed the action to com.myapp.ACTION, it can be easier to just leave it as com.datalogic.decodewedge.decode_action since it will just be one less setting to change.
Drew Hugentobler L3 Mobile Computer Specialist Support Engineer
As I said before, seeing this is not an issue and is not something we are going to change.
This has no impact on your ability to utilize the barcode data Intent Wedge.
What behavior is not meeting your expectation?
Drew Hugentobler
L3 Mobile Computer Specialist Support Engineer
Hi
In the log you’ll see an exception, my test app isn’t receiving the data, if there is something i have not done correctly please let me know (a setting on the device, my intent filter).
11-13 11:52:37.433 E/ActivityManager( 1981): Sending non-protected broadcast com.datalogic.decodewedge.decode_action from system 3291:com.datalogic.service/1000 pkg com.datalogic.service
11-13 11:52:37.433 E/ActivityManager( 1981): java.lang.Throwable
I think the app isn’t receiving the barcode data because of a mismatch between how Decode Wedge sends the intent and how the code receives it.
in your code you use:
An [IntentFilter] attribute on the Activity
OnNewIntent() method to handle intents
This approach works ONLY if Decode Wedge is configured to use START_ACTIVITY mode.
However, in your case Memor 30’s Decode Wedge is configured to send BROADCAST intents (as you can see from the log message “Sending non-protected broadcast…”).
The difference is that while with START_ACTIVITY the Intent is delivered directly to an Activity (explicit intent) → triggers OnNewIntent(), with BROADCAST, the Intent is sent as a broadcast (implicit intent) and requires a BroadcastReceiver to intercept it.
As a result the IntentFilter attribute and OnNewIntent() method are never triggered by implicit broadcast intents.
The solution I would suggest is to create and register a BroadcastReceiver dynamically in code.
Code sample:
protected override void OnCreate(Bundle savedInstanceState)
{
...
// BroadcastReceiver registration
var filter = new IntentFilter("com.datalogic.decodewedge.decode_action");
filter.AddCategory("com.datalogic.decodewedge.decode_category");
RegisterReceiver(new DecodeReceiver(), filter);
}
// Receiver
public class DecodeReceiver : BroadcastReceiver
{
public override void OnReceive(Context ctx, Intent i)
{
var data = i.GetStringExtra("com.datalogic.decode.intentwedge.barcode_string");
var type = i.GetStringExtra("com.datalogic.decode.intentwedge.barcode_type");
}
}
Simone Callegari
SW Engineer - Mobile Computers L3 Support | Datalogic