Office Hours — Today, July 30

Tuesday, July 28

Jul 30
7:20 PM
Mark M.
has entered the room
7:25 PM
Mark M.
turned on guest access
8:10 PM
ConorH
has entered the room
Mark M.
hello Conor!
how can I help you today?
ConorH
Hi Mark - phew, just caught you :)
Background: I am doing some development for a SoM Android boards.
Mark M.
"SoM"?
ConorH
System on Module.
*Not a smartphone.
Mark M.
OK
ConorH
One requirement is to disable or lockdown mouse and keyboard input (via usb connection).
Mark M.
I'm guessing that's you
ConorH
Yes :)
Mark M.
you need a higher-res avatar :-)
8:15 PM
ConorH
Do you know anything about this? I'm sure it's possible via low level Android work but i'm looking for the most practical solution. i.e. as close to the Android SDK as possible or alternatively via shell commands.
8:15 PM
Mark M.
well, it's definitely not possible at the SDK level
ConorH
I need a whole new one :)
Mark M.
there might be some trick to it at the shell level (adb shell or some other root-ish shell)
ConorH
Do you concentrate mainly on the SDK or have you done any hacking outside of it?
Mark M.
no, I'm an SDK guy
ConorH
Ah ok, cool.
View paste
I came across this:

echo 0 > /sys/devices/virtual/android_usb/android0/enable
Mark M.
that being said, I'd look for Linux shell commands that might have your desired effect on, say, Ubuntu, then see if they work on Android
ConorH
Ah ok cool, i'll look for those.
Mark M.
I'm no expert, but that feels like it'd take out more USB stuff than just HID
ConorH
Which i'm sure just disables the USB port. Unfortunately, I still need the ports to work for a USB -> Ethernet adapter.
Mark M.
right
AFAIK, for KB/mouse, Android's using fairly vanilla Linux stuff
ConorH
View paste
Ah ok. Thanks.

Somebody mentioned something about the USBDevice and USBConnection classes in Android.
Do you think there would be something there
Mark M.
so if you could figure out how to block HID input on a Linux desktop, the same approach stands a decent chance of working on Android
ConorH
Ok cool.
Thanks.
Mark M.
at best, you'd be in a similar boat as with your echo 0 command -- you might be able to clog the USB port, but nothing finer-grained than that AFAIK
ConorH
Ok, i'll keep that in mind - thanks.
Mark M.
but, I haven't played with the USB API in the Android SDK
hardware is my kryptonite
8:20 PM
ConorH
Ha ok :)
Mark M.
the closer you get to the metal, the more likely it is that I'm all thumbs
ConorH
I doubt it will offer anything useful anyway. I doubt it would allow you to block a HID device.
Mark M.
you might try your question over on https://android.stackexchange.com, as it's more of an end-user question than a programming one
ConorH
Sure, i'll give it a blast. Thanks.
Also, do you know if there is anything in the SDK for managing the power settings of a device. i.e. disabling screen lock etc?
Mark M.
well, you can keep the screen on
android:keepScreenOn="true"
FLAG_KEEP_SCREEN_ON
or a manual WakeLock
those have the side effect of keeping the device from locking on its own accord
though all of that is trumped by the power button
beyond that, we don't have a lot of power control at the SDK level
ConorH
I see. Well, this board doesn't really have that type of button. Power is via connect/disconnect the power jack :)
I see. Do you know much about ethernet over USB for Android devices?
Mark M.
I seem to recall that it worked when I tried it once on a tablet
ConorH
Ok, do you know which devices you used?
Mark M.
that was a few years ago
8:25 PM
Mark M.
if I had to guess, an ASUS Transformer TF700T
ConorH
That's good, support can only have gotten better, right?
*oops, I meant the USB->Ethernet device?
Mark M.
yeah, I assumed that's what you meant
the key is that I don't know how much of that support is in Android proper or might be added by device manufacturers
ConorH
Ah yea, I guess that's true. Thanks.
Mark M.
in the case of the Transformer, it had a keyboard dock with a real honest-to-goodness USB port
which made it far more amenable to the USB network adapters of the time
ConorH
Ah I see.
Mark M.
I would *think* that Android has it natively, but since I don't think I've tried it since then, I can't rule out that it was an ASUS thing
ConorH
Yea, you're probably right. I've seen reports that Android has native support in later versions but it can be very picky on the hardware devices.
Well, thanks for your help. I guess you must be off now? :)
Mark M.
shortly -- if you have another quick question, go ahead
ConorH
Nope, that's all for now.
Mark M.
OK
ConorH
Thanks for your input :)
Have a good evening.
Mark M.
you are very welcome
you too!
ConorH
lol it's 01:29 here.
Goodbye.
Mark M.
ah
8:30 PM
Mark M.
cheerio! :-)
ConorH
has left the room
Mark M.
turned off guest access

Tuesday, July 28

 

Office Hours

People in this transcript

  • ConorH
  • Mark Murphy