Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Torque Pro w/ USB adapter, prevent auto launch at boot time

Pages: [1]
Author Topic: Torque Pro w/ USB adapter, prevent auto launch at boot time
Baloe
Member
Posts: 2
Post Torque Pro w/ USB adapter, prevent auto launch at boot time
on: July 28, 2014 (GMT)

I’m using Torque Pro together with a USB adapter on an Android car radio, which is working really great so far.

There is just one small issue/annoyance with this configuration, and I’m wondering if anyone has a solution to fix this.

– When the device starts, it broadcasts an USB_DEVICE_ATTACHED because the OBD USB adapter is (still) plugged in. It does this even when it was already attached.
– An Android dialog appears which application to use for this device, with Torque as the only option (depending on which apps you have installed): when selecting Torque, it opens right away. When also selecting ‘use as default application’, it will also automatically open Torque on next boot and also increasing boot time of the radio quite a bit.

Here is where the issue starts: I don’t want it to launch on boot, and I don’t want a popup dialog asking me what to do with the USB device either.

It’s not possible to assign nothing to the USB device and remember that. Remember only works when you actually choose an application. So I made a ‘fake’ USB app which also listens to the same devices Torque does. This way I can select this fake USB app and make this the default. The app immediately closes after starting do that eliminates the annoying startup dialog for me without making Torque the default choice.

So far so good, however now when I open Torque manually it asks for permission to use the USB device. It turns out that only the default application is granted access by default (without a dialog). It would be great if that dialog could also be eliminated, but that seems only possible when you make it default within Android (and thus starts at boot automatically again which I don’t want).

Is there perhaps a possibility of making a setting within Torque which lets you choose to ignore or cancel the futher startup of Torque if it’s launched using the USB_DEVICE_ATTACHED event? That would make it possible to set Torque as default app again, without having it launched at device boot. Or perhaps someone has an other solution?

piemmm
Administrator
Posts: 6629
Post Re: Torque Pro w/ USB adapter, prevent auto launch at boot time
on: July 28, 2014 (GMT)

Hi!

Unfortunately the popup dialog is controlled by android itself – when it detects a USB device, it scans the app manifest, and looks for compatible apps

If it finds one, it pops up the GUI, however as you’ve seen, if you have 2 and select the other app, then Torque doesn’t receive the USB permission and you then have to assign it access manually

So far, I haven’t seen a way in Android to change this behaviour. The app needs exclusive control over the adapter if it is to have access, and that’s granted by the permission request that you see on screen (if you have 2 apps installed, and give the other app default permission)

There is a ‘delay OBD connection’ setting in the settings, this will prevent Torque from doing anything for 10 seconds (this should let the unit boot up fully faster). Though the unit shouldn’t really need to boot after it’s done it the first time (you shoudl have permanent +12v and switched +12v, and the switched input should simply wake the android device up out of deep sleep, so it doesn’t need to fully boot (and give you these issues)) – it may be an idea to check this

Alternatley I would recommend turning on the ‘start on boot’ option with the ‘delayed OBD start’ option. This will mean that the minimal part of Torque is loaded (it only loads bits when it needs them) so this will then let the headunit continue booting without Torque getting in the way

Baloe
Member
Posts: 2
Post Re: Torque Pro w/ USB adapter, prevent auto launch at boot time
on: July 29, 2014 (GMT)

Thanks for your reply and suggestions.

The (Chinese) car radio is wired properly and detects if ignition is turned off (shuts down Android). Unfortunately those devices really shut down so it boots completely when you turn on ignition again (after a couple of minutes delay). I will keep your tip about the delay in mind.

I tried the start at boot options already before your suggestion. It seems it just opens Torque twice when I enable this option and have Torque the default app for the USB device. Or at least I see the Torque dashboard dials ‘resetting’ or rotating twice (from vertical to horizontal aligment) when I do. I got the dashboard as startup screen in settings. At least the USB_DEVICE_ATTACHED fires before the BOOT_COMPLETED.

You are right about Android and not able to change this permission behaviour, so from that perspective there is nothing wrong with either Torque or Android. But it’s still annoying though.

I was wondering it it would be possible to put the USB_DEVICE_ATTACHED filter on some seperate Activity within Torque, so you could detect Torque was triggered by USB_DEVICE_ATTACHED instead of a regular launch. Then a new setting within Torque could prevent the launch of Torque through this event. This way Torque is the default app and has full permission, but still does not open automatically when the USB device is plugged in at boot time (or when plugged in manually after boot).

hatharry
Member
Posts: 2
Post Re: Torque Pro w/ USB adapter, prevent auto launch at boot time
on: March 27, 2015 (GMT)

Would you be so kind and share your usb app?

migselv
Member
Posts: 1
Post Re: Torque Pro w/ USB adapter, prevent auto launch at boot time
on: July 29, 2015 (GMT)

Hi.

I’m in kind of the same situation as Baloe.

I have a car multimedia system (Android based) build into my car which I have hooked up using the Scantool USB adapter to my car’s OBD port.

Like with Baloe’s system my Android unit is turned off once the ignition is turned off.

Upon startup I receive up to two dialogs from Android:
One asking to start/assign an application (Torque) with the USB device
Another asking to grant access to the USB device by Torque

The second will only pop up is you press cancel (or ignore) the first one.

If you choose to set Torque to be the default APP in any of the two dialogs, Torque will be started automatically at every single startup of Android.

Now, I’m actually using the Torque Widget (made by Ian) to display specific checks on my home screen. I almost never use the Torque APP itself. With the Widget comes an ON/OFF switch which lets Torque to be started in the background as a service.

Now my question:
Wouldn’t it be possible to associate the USB device with the Torque background service (or Widget APP) for automatic startup.
This would be perfect for me as you would get rid of the annoying dialog boxes and overall startup would be quicker as the main Torque application with GUI will not be loaded. At the same time my widget displays will be turned on automatically.

Is it possible to make the necessary adjustments in Torque to select how to start Torque upon the right USB trigger/event. Selections could be:
Start Torque in foreground
Start Torque in background

This would be so great!

Andriod Rav4
Member
Posts: 2
Post Re: Torque Pro w/ USB adapter, prevent auto launch at boot time
on: September 26, 2015 (GMT)

I come to the forums just for this info..

“Is it possible to make the necessary adjustments in Torque to select how to start Torque upon the right USB trigger/event. Selections could be:
Start Torque in foreground
Start Torque in background
This would be so great!”

So great feature request please!

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.079 seconds.

  Follow me on twitter