USB/RS232 communcation security exception android.permission.sec.MDM_APP_MGMT

Viewed 1439

I have created an Android app that runs on a Samsung Galaxy Tab Pro (SM-T900). The main feature of this app is RS232/USB communication using the USB host mode and the USB-to-Serial library.

This app has been working perfectly without the need for any code updates for over a year. However, since the latest Samsung/Android update to Android 5.1, I get a security error and I am no longer able to communicate with USB/RS232 devices. Apart from that, my app runs fine without any crashing. I am simply no longer able to perform USB/RS232 communication.

Here's the logcat:

03-24 17:03:09.015 2798-3149/? D/UsbSettingsManager: requestPermission:/dev/bus/usb/002/008 ,packageName com.example.pumpconnector ,pi PendingIntent{338f59ea: PendingIntentRecord{1fd58866 com.example.pumpconnector broadcastIntent}}
03-24 17:03:09.020 2798-3149/? D/ApplicationPolicy: isUsbDevicePermittedForPackage vendorId: 1027, productId: 24577, package: com.example.pumpconnector
03-24 17:03:09.020 13313-13332/com.example.pumpconnector V/MainActivity: java.lang.SecurityException: Admin  does not have android.permission.sec.MDM_APP_MGMT

The app has been configured to start whenever a USB device is attached to the device, which still works on the Samsung tablet. The app works perfectly fine on other (non-Samsung) devices. It's fully functioning on a LG Nexus 5 with Android 6.0.1. installed and also on a Moto G with Android 5.1. A little Google search on the exception quickly points to Samsung specific update/bug that prevent USB communication (check this thread).

I tried to put the following line in the Manifest (without result):

<uses-permission android:name="android.permission.sec.MDM_APP_MGMT"/>

Is there any way to get my app to get the android.permission.sec.MDM_APP_MGMT without having to wait for Samsung to fix it? All help is appreciated.

1 Answers
Related