

#Tasker turn off screen code
However with a if else loop (it could be reduced further since I had added some additional debugging code initially) you can simply set AutoRotate based on the value of Orientation. Since my device is not rooted the shell code commands that require root would not work anyway. So based on that I came up with my own solution which may seem a bit convoluted but it works for me.

You can also hide Tasker's notification icon through its settings.Īnd Tasker even allows you to add conditional's such as if my display is such do this else do whatever.
#Tasker turn off screen android
Some Android versions might ask you to enable Tasker's accessibility service. Under PROFILES tab tap + → Application → choose Maps → New Task→ name it something and tap right icon. Tasker will change/close the active window and would save the settings.) (Note that once you're done changing something in Tasker, tap Back key once. Create a profile in Tasker with inverse of Application → Maps.You'll now see a shortcut with icon you selected in step 4 and name chosen in step 2.To change th icon of the shortcut, tap 3x3 square icon (at the bottom of Task Shortcut window) and choose the icon.Create another action as + → App → Launch App → select Maps.Go to your default launcher → Widgets and choose Task Shortcut.Ĭreate an action as + → Code → Run Shell, and enter the following details:.However, the app can be directly launched into Landscape mode by using an app shortcut.

The shortcoming in the last method is that on some devices the app will first open in Portrait mode and then will force shift into Landscape mode. This edit is meant for users like me who on slow devices have to wait for the app to follow their orientation. (Note that OP has Auto-rotation feature off so it should work.) Once you close it the device will come back to Portrait mode.
#Tasker turn off screen manual
The Maps will now automatically go into Landscape mode irrespective of manual orientation of your device. Command: settings put system user_rotation 0.Create another profile with inverse of Application → Maps.Command: settings put system user_rotation 1.Create a profile with Application → Maps.Ĭreate an action under Task of the above profile as + → Code → Run Shell, and enter the following details:.(Tested on Android 4.2.1, root required only under this edit.) There is a way you can force the system to go into Landscape mode by changing a value in settings.db. Close the Maps and device will fall back to Portrait. Open Maps and orient your device in landscape mode, Maps will follow you. Create an action under Task of the above profile as + → Display → Display AutoRotate and Set it to On.Create a profile with Application → Maps.This solution requires Tasker installed and enabled.
