Sending non-protected broadcast using Intent Wedge

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.

Hello again @Tobia_Scapin,

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.

  • Entirely remove the category from Datalogic setting and disable the WEDGE_INTENT_EXCLUDE_EMPTY_VALUES
  • 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

1 Like

hi i have the same issue, code below memor 30, any assistance greatly appriciated.

using Android.Content;
using playAndroid;

namespace DatalogicScannerDemo
{
    [Activity(Label = "Datalogic Scanner Demo", MainLauncher = true)]
    //[IntentFilter(new[] { "com.datalogic.decodewedge.decode_action" })]
    [IntentFilter(
        new[] { "com.datalogic.decodewedge.decode_action" },
        Categories = new[] {
            Intent.CategoryDefault,
            "com.datalogic.decodewedge.decode_category"
        })]
    public class MainActivity : Activity
    {
        TextView _resultText;
        
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            //SetContentView(DatalogicScannerDemo.Resource.Layout.activity_main);


            _resultText = FindViewById<TextView>(Resource.Id.resultText);
            _resultText.Text = "Scan a barcode...";
        }
        
        protected override void OnNewIntent(Intent intent)
        {
            _resultText.Text = "OnNewIntent \n";
            base.OnNewIntent(intent);
            HandleIntent(intent);
        }
        
        private void HandleIntent(Intent intent)
        {
            _resultText.Text = "HandleIntent \n";
            _resultText.Text = $"HandleIntent: {intent?.Action }\n";

            if (intent?.Action == "com.datalogic.decodewedge.decode_action")
            {
                string barcodeString = intent.GetStringExtra("com.datalogic.decode.intentwedge.barcode_string");
                string barcodeType = intent.GetStringExtra("com.datalogic.decode.intentwedge.barcode_type");
                string barcodeData = intent.GetStringExtra("com.datalogic.decode.intentwedge.barcode_data");

                if (!string.IsNullOrEmpty(barcodeData))
                {
                    RunOnUiThread(() =>
                    {
                        _resultText.Text = $"Scanned: {barcodeData}\nType: {barcodeType}\nData: {barcodeData}";
                    });
                }
            }
        }
    }
}

Error:

11-13 11:52:37.428 V/DL-scanToEVL_Stub( 3291):  BufferAvailable 678
11-13 11:52:37.428 D/DL-StdFormatter( 3291): VisualFormatter enable false timeout 500
11-13 11:52:37.428 I/DL-StdFormatter( 3291): buildLabelData: 930067501141
11-13 11:52:37.428 D/DL-StdFormatter( 3291): Standard time 0
11-13 11:52:37.429 D/DL-StdFormatter( 3291): Total time 1
11-13 11:52:37.429 D/DL-ScannerController( 3291): Checking pending configuration 0
11-13 11:52:37.430 D/MediaRouter( 1981): onRestoreRoute() : route=RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
11-13 11:52:37.430 V/MediaRouter( 1981): Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
11-13 11:52:37.431 D/DL-LedManagerService_JNI( 3323): `set_led` took 2 ms
11-13 11:52:37.432 D/DL-LedManagerService_JNI( 3323): `set_led` took 1 ms
11-13 11:52:37.433 W/CHIUSECASE( 1201): [WARN   ] chifeature2realtime.cpp:1798 PopulateSensorModeOnMetadataResult() [InSensorZoom] FRO-URO:53_RealtimeFG:RealTime_0 Fail to translate ROI metadata for InSensorZoom: Required data unavailable: pMetadata: 0xb400006e88ab4510, pInSensorZoomInfo: 0x0, m_pRoiTranslator: 0x0 pCameraInfo 0x6d6b3d6c10
11-13 11:52:37.433 W/ContextImpl( 3291): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1189 android.content.ContextWrapper.sendBroadcast:500 com.datalogic.provider.IntentWedgeThread.handleMessage:141 com.datalogic.provider.IntentWedgeThread$IntentWedgeHandler.handleMessage:62 android.os.Handler.dispatchMessage:106 
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
11-13 11:52:37.433 E/ActivityManager( 1981): 	at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:13811)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:14533)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:13829)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at com.android.server.am.ActivityManagerService.broadcastIntentWithFeature(ActivityManagerService.java:14707)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2296)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2658)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at android.os.Binder.execTransactInternal(Binder.java:1280)
11-13 11:52:37.433 E/ActivityManager( 1981): 	at android.os.Binder.execTransact(Binder.java:1244)

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

Hello @matt_daniel,

If you look above your message I answer it in detail.

It sounds like you need a support agent to discuss the issue with directly.
Please create a ticket at:

Drew Hugentobler
L3 Mobile Computer Specialist Support Engineer