Android Server: Persistent Device Permissions?

Whenever I restart my Android device (Shield TV), the device permission dialog pops up again for all devices connected and not ignored. However, I noticed that this dialog is not shown if I plugin / activate the USB devices a bit after the reboot. They work just as usual after that. Is it possible that deferring the Virtual Here startup would get rid of having to confirm the permission dialog time and again?

#2

I dont have control over that, its android that schedules when things start, seems like a bug in android...

#3

The box is pretty stable and I'm not restarting it that often, so maybe just manually starting Virtual Here is the best option with three or more devices connected.

#5

OK yes thanks for the tip, ill investigate this further over the next few days

#6

thank you Michael, hope to hear good news soon. ;)

#7

Going back through my code, i see that i already do all that.

When the device boots there is no USB_DEVICE_ATTACHED events from any attached USB devices, because the usb device is already there there was no "attach" occuring, which makes sense because Android couldnt know the right time to send that event on startup.

I think this is the bug in android, because when the device is enumerated on boot android just always returns false to hasPermission even though the user previously granted permission. Its as if the android developers werent expecting a service to use a usb device on boot, only activities started afterwards.

#8

I see Michael... thanks for your clarification.

#9

hey Michael,

after much research and testing, I have successfully configured Tasker to suppress the plesky dialog box that Android USB shows after every reboot of the device. However if the VirtualHere USB server "boot on startup" option is enabled, it will load up first (before Tasker) rendering the task useless because the dialog box already loaded during startup.

Is it possible to add a delay timer to the boot on start option on Android USB Server? Would appreciate this function, thanks.

#10

No for the time being i cant make that change

#11

is there any workaround for the startup delay?

One possibility is disable start on boot on VirtualHere Server and then create a delayed boot profile on Tasker but I need to know the service name VirtualHere uses to start the service in the background during boot (not to open the app).

#12

Yes you could try to start the service using Tasker. The service is called com.virtualhere.androidserver.DaemonService . Let me know how it goes

#13

nope not working, getting error 255 on Tasker, not sure where is the problem.