Car Dock and Desk Dock modes without an OEM dock

I've given other people suggestions on how to do this with Tasker, but have always had OEM docks myself, and never really needed to test my suggestons first hand. Now I have an Otterbox Defender case for my Droid Bionic, and can no longer use the Motorola docks. Following my previously suggested solutions left my profiles lacking, so here I am with something that works well (for me, at least).

I prefer portrait mode when in the car, so the obvious solution was: if the phone is powered and upright, car mode is triggered; if it's powered and on it's left side, desk mode is triggered. It turned out to not be that simple, since the jostling in the car tended to confuse the orientation sensors, causing car mode to exit and resume frequently. What I ended up doing was triggering the different modes as indicated above, but making it so that the phone would stay in each mode as long as it's powered, regardless of orientation. Now once in car mode, the phone can get endlessly jostled, or even turned to a landscape orientation purposely, and it will stay in car mode. This makes the solution also work for people who prefer landscape orientation in the car - simply hold the powered phone upright until car mode is triggered, then rotate to your desired orientation.

Here are the Tasker profiles I came up with:

Profile: Car Dock Activate
Context: Power Any
Context: Orientation Standing Up
Enter Task:
Stop

Profile: Car Dock Maintain
Context: Power Any
Context: Variable Value %PACTIVE *,car dock *
Enter Task:
Profile Status Off [Desk Dock Activate]
Car Mode On
GPS On
Wifi Off
Mobile Data On
Get Location GPS 100
Media Volume 15
In-call Volume 7
Silent Mode Off
Ringer Volume 15
Notification Volume 15
Vibrate On Ringer Off
Vibrate On Notify Off
Speakerphone On
Stay On With AC or USB Power
Exit Task:
Profile Status On [Desk Dock Activate]
Car Mode Off
Wifi Off
Mobile Data On
GPS Off

Profile: Desk Dock Activate
Context: Power Any
Context: Orientation Left Side
Enter Task:
Stop

Profile: Desk Dock Maintain
Context: Power Any
Context: Variable Value %PACTIVE *,desk dock *
Enter Task:
Profile Status Off [Car Dock Activate]
Load App Smart Dock (this is the clock app for the Bionic)
Exit Task:
Profile Status On [Car Dock Activate]
Auto Brightness On

Obviously you can add your own actions to the enter and exit tasks, but what's shown above is what I have, minus any actions necessary to integrate with other profiles.

In both cases (car and dock), the "activate" profile is activated by the contexts used originally - Power and Orientation. When either of these profiles activates, Tasker updates the %PACTIVE variable to include the name of the profile that activated. This in turn satisfies one of the contexts of the corresponding "maintain" profile. Since Power is a required context for either of the "activate" profiles, this means that the Power context for the "maintain" profiles is satisfied too. So once an "activate" profile is activated, the corresponding "maintain" profile is also activated.

Once a "maintain" profile is activated, Tasker updates the %PACTIVE variable to include the name of the profile that activated. Now, here comes the key to the whole thing - the fact that a "maintain" profile is active, satisfies the second context for keeping that very same profile active. This means that the only remaining context required to keep the profile active is Power. So, once activated, the profile will remain active as long as the phone is powered.

Also, each "maintain" profile disables the "other" "activate" profile, preventing the phone from switching between car and desk mode while the powered.

-UncleMike

nfc
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License