Screenshot_2013-07-02-14-13-45Some features of Android are impossible to control even with root, for what Google tends to call security purposes. Controlling which app should be the default app for an action (like clicking the home button or opening a URL) is one of those, and it can get a bit annoying when an OS that’s infamous for having security issues out of the box starts dictating what the power user part of its user base can and cannot do. Luckily, using Tasker, there is a way you can switch which app is the default for an action, using a clever trick.

Today’s quick Tasker tip is based off a very useful post on Reddit from last year, and all credit should go to its creator, laharah.

The way default actions work in Android is that whenever you only have one app that can perform an action, it will automatically use that app, but if there are more than one app, it will ask the user what to do. There is no way that I’m aware of to set this without actual user input (let me know if there is one), which leaves us with one option: disabling apps to make the system think there’s only one app that can perform an action. By freezing all the apps that can perform an action except one, only that final one will remain visible to the system, and it will use that one without asking. By unfreezing the frozen apps and freezing the other app, you can switch which app is visible to the system, and hence control which app is being used for an action.

This method requires root, and there’s no getting around that. On top of that, you won’t be able to use the apps that are frozen without unfreezing them, which can be a problem in some cases.

To actually do this, you need the Secure Settings plug-in, and you need to make sure it has root privileges. There is a Secure Settings action that you can then access, and one of the options in the configuration for it is  called Package State. This option will ask you to select an app, and then give you three options: Enabled, Disabled, and Toggle.

What you need to do is use this action to disable all the available apps for an action except one, using a task that consists of multiple Secure Settings actions that deal with each app. If you for instance want to use this to switch between Apex launcher and ssLauncer, you would need to enabled one when you disable the other to switch.

This is the very definition of a workaround, so there might be unforeseen issues with certain devices, ROMs, apps, etc. Still, in my experience, Android and the apps themselves handle being frozen and unfrozen with ease, and all this does is give Tasker the ability to do that.

As for why you would want to do it, well, I already mentioned launchers. Want a different home screen for work than for home? No problem, just use two different launchers and switch them using profiles for work and home! Want to use a specific PDF reader at the office and another one for reading at home? Go ahead!

I wasn’t aware of this trick until I discovered it on Reddit a while back, and I have to say I love it. I’m not a fan of Google dictating what I can and cannot do with my rooted phone, and I love any trick that gets me around those restrictions.