Skip to main content

Android Intents

The DXU Android agent exposes several intents. These are useful for 3rd party applications, such as MDM clients to perform actions such as:

Apply DXU settings​

Used to apply a DXU configuration from a .dxu file on the device.

note

You 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

Broadcast Receiver​

com.datalogic.dxu.plugin.EnterpriseReceiver

Extras​

ExtraTypeRequiredDefaultDescription
uristringnonullcontent URI provided by FileProvider
pathstringnonullpath to file located on device

Examples​

/* Assumes a Uri has been made using a FileProvider */
Intent i = new Intent("com.datalogic.dxu.action.APPLY_SETTINGS")
.putExtra("uri", uri.toString())
.setClassName("com.datalogic.dxu", "com.datalogic.dxu.plugin.EnterpriseReceiver");

getApplicationContext().grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

getApplicationContext().sendBroadcast(i);

Firmware Update​

Firmware update process is initiated, passing as extras the path of the OTA package (.zip file) to be loaded and some optional parameters.

Broadcast Action​

com.datalogic.dxu.action.FIRMWARE_UPDATE

Broadcast Receiver​

com.datalogic.dxu.plugin.FirmwareReceiver

Extras​

ExtraTypeRequiredDefaultDescription
pathstringyesnullpath to file located on device
forcestringnofalseIf true, update will be applied even if versions match
silentstringnofalseIf false, popup window to confirm update will appear
resetTypestringnononeSpecifies whether or not all the device's setting should be reset as part of the firmware update procedure. Valid values are:
• none - no reset will be performed
• enterprise - perform an enterprise reset
• factory - perform factory reset

Examples​

Intent i = new Intent("com.datalogic.dxu.action.FIRMWARE_UPDATE")
.putExtra("force", "false")
.putExtra("silent", "true")
.putExtra("resetType", "none")
.putExtra("path", "sdcard/OS.zip")
.setClassName("com.datalogic.dxu", "com.datalogic.dxu.plugin.FirmwareReceiver");

getApplicationContext().sendBroadcast(i);

Device Reset​

Used to either reboot the device or perform a full enterprise or factory reset.

note

This intent requires that the broadcaster have the com.datalogic.dxu.PLUGIN permission.

Broadcast Action​

com.datalogic.dxu.action.RESET

Broadcast Receiver​

com.datalogic.dxu.plugin.ResetReceiver

Extras​

ExtraTypeRequiredDefaultDescription
typestringnoRESETspecifies the type of reset to perform. Values map to BootType values:
• RESET - reboot the device only
• ENTERPRISE_RESET - perform a full enterprise reset of the device ⚠️
• FACTORY_RESET - perform a full factory reset of the device ⚠️

Examples​

// assumes we have <uses-permission android:name="com.datalogic.dxu.PLUGIN" /> defined in AndroidManifest.xml

Intent i = new Intent("com.datalogic.dxu.action.RESET")
.putExtra("type", "RESET")
.setClassName("com.datalogic.dxu", "com.datalogic.dxu.plugin.ResetReceiver");

getApplicationContext().sendBroadcast(i, "com.datalogic.dxu.PLUGIN");