Set PTP as USB Default Mode

Solved Locked
D
Daniel
Hornbach Baumarkt AG

Hey Guys,

does anyone knows an app, intent, script command or something else to change the USB Mode in Android Nougat to PTP?

Our Devices (Zebra TC20) running in an kioskmode and our Users don't have access to the Filesystem and I dont want to grant them just for copying some pictures. Unfortunately the USB-Setting for PTP by Zebra MX is not working on the TC20 Devices so I'm looking for an alternative way.

I already wrote an App for some other Systemsettings to set, so feel free to send me every single Idea ;-)

Thanks

6 years ago
Android
ANSWERS
D
Daniel
6 years ago

As I said before, USB Settings by Zebra MX is not supported on the TC20.

Anyway, I found a solution. It's not setting PTP as default USB Connection Type but this also works for us.

I added this Entry to the Kiosk-Mode:

        <A href ="<MCLink0>" style="visibility: hidden">USB</a>

and the App-ID is "Launch://com.android.settings/.deviceinfo.UsbModeChooserActivity"

This allows the User to open the USBChosserActivity-Menu to set up the USB Connection but only this activity. So the Users can not change any other Setting

Maybe this is helpful to other Users ;-)

Solution
T
TDMOD@SOTI
6 years ago

Hello Daniel - Can you explain a little bit about how you would be using this feature for MobiControl. I would like to get you the best answer we can for this.

RC
Raymond Chan Diamond Contributor
6 years ago

What is the device brand and model you are working on?

Are you using Android plus or Android Enterprise device agent?   What are the version and build numbers?

D
Daniel
6 years ago

Our Devices (Zebra TC20, Android 7.1.2, MC Agent 13.5.1. Build 1273, DA Mode) using the Soti Kioskmode as shown here:

Access to Settings is not granted. The Users can only use the Apps we published in KioskMode.

One App of them is the Android Camera, so they can take pictures and show them in Gallery. Now we would like to unlock the PictureBridge-Feature so they can donwload the pictures to a PC or Notebook with an USB-Cable. When we plug in the USB Cable, the Status-Bar of Android shows up the USB-Connection Menu but this is not accessable in the Kioskmode.

And thats the Point: We want to set up PictureBridge as the Default USB Mode. There is a way in Zebra MX but unfortunately this Setting is not supported by the TC20. So we're looking for an other solution. I thought about a Script or intent as "app" in the Kiosk-mode which should be clicked when the device is connected to a PC so that USB-Settings changing to PTP instead of "only charging"...

The USB-Menu-Activity is called com.android.settings/.deviceinfo.UsbModeChooserActivity

For me there a maybe to ways to solve this Problem: 1.) We can set up PTP as the USB-Default-Setting with an App or something else or 2.) We can set up a Script or something else in the kiosk-mode which has to be started when USB-Connection is established to change the USB-Mode

Many Thanks Guys

RC
Raymond Chan Diamond Contributor
6 years ago

Since your devices are from Zebra, your best bet is probably to check if the Zebra's MX layer on your device supports setting of USB default connection option.   If so, the MobiControl script to use is "mxconfig" on an xml file with the right parameters accordingly.