USB Host Mode - device access permission granted but not remembered

2,797 views
Skip to first unread message

Greg Gradwell

unread,
Dec 25, 2013, 10:26:59 AM12/25/13
to ioio-...@googlegroups.com
I'm having a issue similar to this one:
http://stackoverflow.com/questions/12388914/usb-device-access-pop-up-supression

When presented with the dialog asking to allow the app to access the USB device, even if I check the "Use by default for this USB device", this setting is not remembered the next time I connect the IOIO.

For what it's worth, when I check the box, underneath I get the message "Clear default in System settings > Apps > Downloaded", even though I have made sure that this is cleared and no apps are set to launch by default.

Also, the IOIO will successfully connect whether or not I have the USB_ACCESSORY_ATTACHED intent filter and meta-data in the manifest, which seems strange.

Ytai Ben-Tsvi

unread,
Dec 27, 2013, 12:52:11 AM12/27/13
to ioio-...@googlegroups.com
Does this happen if you plug in the IOIO when the app is not running and you're choosing the app from the app selection dialog that pops up?


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/groups/opt_out.

Greg Gradwell

unread,
Dec 27, 2013, 8:46:37 AM12/27/13
to ioio-...@googlegroups.com
No, this is when the app is already running and I connect the IOIO. I get the dialog "Allow the app <app> to access the USB device?". My device is connecting as the host, and the IOIO as the accessory, in case that wasn't clear. If I connect the IOIO without the app opened, no dialog appears.

Ytai Ben-Tsvi

unread,
Dec 29, 2013, 12:04:08 PM12/29/13
to ioio-...@googlegroups.com
I've never seen such a behavior. Let's just verify that again. Is this correct?
  • When you connect the IOIO to the Android with USB debugging turned off you're not seeing a dialog popping up.
  • However, if you start the app manually at this point, you're getting the permission dialog, and if you approve the app runs fine.
And another question: do you have the accessory filter in your AndroidManifest file setup correctly? It might be that it's not and your Android just happens not to present the "unknown accessory" dialog.


--

Greg Gradwell

unread,
Dec 30, 2013, 9:27:15 AM12/30/13
to ioio-...@googlegroups.com
Yes, whether debugging is "on" or "off", if I connect the IOIO when the app isn't running, nothing happens. If I connect when the app is running, I get the message shown in the screenshots below. Even if I check the "Use by default..." option, I still get the message if I disconnect and reconnect the IOIO. Note, I don't have any other apps set as the default, so I don't know why I get that "Clear default in System settings..." message.

I first encountered this issue when using a IOIOService, so I thought maybe it was that. But I also get it when using a IOIOActivity, as with this project.
The links to my manifest and accessory filter are below. Hopefully it's just a problem with my manifest. That would be a simple fix.


Ytai Ben-Tsvi

unread,
Dec 30, 2013, 10:41:39 AM12/30/13
to ioio-...@googlegroups.com
--

Ytai Ben-Tsvi

unread,
Jan 1, 2014, 1:28:34 AM1/1/14
to ioio-...@googlegroups.com

Let's try to separate variables here... Please install the pre-compiled HelloIOIO.apk that's in the software bundle on your device and see how it behaves. This will tell us whether the problem is related to your app or not.

--

Greg Gradwell

unread,
Jan 2, 2014, 11:59:28 PM1/2/14
to ioio-...@googlegroups.com
Okay, I got it working. The app will now start when the cable is connected. The problem was in my manifest. I originally only had the USB_ACCESSORY_ATTACHED intent-filter and meta-data, so I had to add the USB_DEVICE_ATTACHED intent-filter and meta-data (the Wiki didn't show this step). What I don't understand is that it will work even if I don't have the /res/xml/ folder and files. Does this make sense?

Ytai Ben-Tsvi

unread,
Jan 3, 2014, 12:45:00 AM1/3/14
to ioio-...@googlegroups.com
The Wiki still has no information on using the IOIO as a device with Android, as this feature has not been officially released. I will hopefully get around to updating the Wiki shortly.
The res/xml stuff has been moved into the library in the latest (unreleased) version that you're using, for your convenience. This is true for both AOA modes (host, device).


--

Greg Gradwell

unread,
Jan 3, 2014, 6:06:00 PM1/3/14
to ioio-...@googlegroups.com
Okay, gotcha. Thanks so much for the help.
Reply all
Reply to author
Forward
0 new messages