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:
- applying DXU settings
- initiate firmware updates
- perform device resets
Apply DXU settings
Used to apply a DXU configuration from a .dxu file on the device.
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
Extra | Type | Required | Default | Description |
---|---|---|---|---|
uri | string | no | null | content URI provided by FileProvider |
path | string | no | null | path to file located on device |
Examples
- Java uri example
- Java path example
- ADB path example
/* 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);
Intent i = new Intent("com.datalogic.dxu.action.APPLY_SETTINGS")
.putExtra("path", "sdcard/Download/myfile.dxu")
.setClassName("com.datalogic.dxu", "com.datalogic.dxu.plugin.EnterpriseReceiver");
getApplicationContext().sendBroadcast(i, "com.datalogic.dxu.PLUGIN");
adb shell am broadcast -a com.datalogic.dxu.action.APPLY_SETTINGS -n com.datalogic.dxu/.plugin.EnterpriseReceiver -e path "sdcard/Download/config.dxu"
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
Extra | Type | Required | Default | Description |
---|---|---|---|---|
path | string | yes | null | path to file located on device |
force | string | no | false | If true , update will be applied even if versions match |
silent | string | no | false | If false , popup window to confirm update will appear |
resetType | string | no | none | Specifies 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
- Java
- Shell
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);
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
Device Reset
Used to either reboot the device or perform a full enterprise or factory reset.
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
Extra | Type | Required | Default | Description |
---|---|---|---|---|
type | string | no | RESET | specifies 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");