Discover some of the Datalogic Android intents which can allow you to control your devices through MDM scripting

Configuring Datalogic Devices through MDMs

Nowadays, Android technology is progressing quite fast and the enterprise demands have increased. Businesses require that that the network administrator has full control of the terminal through the use of MDM.

For an easier implementation of these systems in the staging and management phase of its devices fleet, Datalogic has introduced special mechanisms within its systems that allow, through an MDM and Android intents, a quick and effective remote configuration of all the installed assets every time a new firmware version is released.
These actions are public to third party developers.

 

1) Apply DXU settings

Used to apply a DXU configuration from a .dxu file on the device. Must specify either "uri" or "path".
If both given, "uri" is used. If neither given, nothing happens.

Broadcast Action:

com.datalogic.dxu.action.APPLY_SETTINGS

Extras:

String "uri": content URI provided by FileProvider 
String "path": path to file located on device

Java example:

/* Assumes a Uri has been made using a FileProvider */
publicvoid sendConfig(Context context, Uri uri)
{
    String packageName = "com.datalogic.dxu";
    Intent i = new Intent("com.datalogic.dxu.action.APPLY_SETTINGS")
        .putExtra("uri", uri.toString())
        .setPackage(packageName);
    context.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
    context.sendBroadcast(i, "com.datalogic.dxu.PLUGIN");
} 

ADB Example:

$ adb shell am broadcast -a com.datalogic.dxu.action.APPLY_SETTINGS -e path sdcard/Download/config.dxu

 


 

2) Firmware Update (StartService)

FW Update process is initiated by starting a service, passing as extras the path of the OTA package (.zip file) to be loaded and some optional parameters.

Service Action:

com.datalogic.systemupdate

Extras:

String "action":  use 2.  Fixed value for FW Update
String "path": path to an OTA package file located on device
String "force_update": If 1, update will be applied even if versions match (Optional, default "0")
String "reset": use 0 for none, use 1 for enterprise reset, use 2 for factory reset (Optional, default "0")

Java Example:

public void resetDevice(Context context)
{
  Intent i = new Intent(); i.setComponent(new ComponentName("com.datalogic.systemupdate", "com.datalogic.systemupdate.SystemUpgradeService"));
i.putExtra("action", 2)
.putExtra("path", "/sdcard/ota_package.zip") // Path to the upgrade package
.putExtra("reset", reset_type) // reset_type = 0: none, 1= enterprise reset, 2 = factory reset.
.putExtra("force_update", force_update_type); /* 0 or 1 */
ctx.startService(i);
}

ADB Example:

$ adb shell am startservice -n com.datalogic.systemupdate/com.datalogic.systemupdate.SystemUpgradeService --ei action 2 -e path sdcard/OS.zip

 

2bis) Firmware Update (Intnet)

As a convenience, a corresponding Broadcast Receiver is available in DXU agent to starts the above service.

Broadcast Action:

com.datalogic.dxu.action.FIRMWARE_UPDATE

Extras:

String "force": If true, update will be applied even if versions match (Optional, default "false")
String "silent": If true, popup window to confirm update will appear (Optional, default "false")
String "path": path to file located on device

ADB Example:

$ adb shell am broadcast -a com.datalogic.dxu.action.FIRMWARE_UPDATE -n com.datalogic.dxu/.plugin.FirmwareReceiver -e force false -e silent true -e path sdcard/OS.zip

 


 

3) Device Reset

Used to reset the device.

Broadcast Action:

"com.datalogic.dxu.action.RESET"

Extras:

String "type": Specify the type of reset to perform: "RESET", "ENTERPRISE_RESET", or "FACTORY_RESET". (Optional, default "RESET")

Java example:

public void resetDevice(Context context)
{
    String packageName = "com.datalogic.dxu";
    Intent i = new Intent("com.datalogic.dxu.action.RESET")
            .putExtra("type", "RESET")
            .setPackage(packageName);
    context.sendBroadcast(i, "com.datalogic.dxu.PLUGIN");
}

ADB Example:

$ adb shell am broadcast -a com.datalogic.dxu.action.RESET -e type ENTERPRISE_RESET



(S.C.)