Switch to default keyboard in password fields I primarily use SwiftKey keyboard on my Samsung Galaxy 10.1 tablet. I want to find a way to automatically switch to the default Samsung keyboard when I enter a password. Currently I have to pull down the notification tray and choose "Select input method". I want to have this automated. If it is not possible to detect whether you are entering a password then maybe I can do it on a per app basis.
The goal may seem to be switching the keyboard app when the password is to be entered, but the real issue is to protect the password from being logged by third-party keyboard apps, or at least be restricted from being uploaded somewhere. In that case, I suggest using a firewall so that you can restrict any app from connecting to Internet, let alone it can send the passwords among other things.

Be it a rooted device or not, there are firewall apps available to suit your needs. Some of them are mentioned here:


Closing internet access for some apps (see my answer here)
Block apps from accessing the Internet on Android device


I've tested two firewall apps: AFWall+ (needs root access), and NoRoot Firewall, former tested on Android 4.2.1, 4.4.2 and 5.0.2, while the latter is tested on Android 4.2.1, and 4.4.2.

Since your device is rooted, I suggest using AFWall+ to be in control of the device. It runs default in White list mode i.e. all the apps including System apps and Kernel are denied root access. You can change that mode however.

Things to do


Install the app
Tap the three dots vertical line next to lens icon &rarr; Preferences, and check the options suitable to you. I prefer:


Show notification icon
Show filter option -- it will break the app list into "All", "Core", System", and "User".
Active Rules
Confirm box on AFWall+ disable
Enable Firewall logs
Turn on log service
Device Admin; and others you won't need

Choose Blacklist mode over White list mode if you intend to block specific apps while allowing Internet access to everything apps

 (Click image to enlarge)

 
Find your app in the list (under "All" or "User") and check the boxes at its left if you're in Blacklist mode, or have it unchecked for White list mode.
Choose Apply by tapping that three dots vertical line, and you're good to go. You can check Firewall logs after sometime for assurance.


As for NoRoot Firewall, it's very intuitive, straightforward, runs in Blacklist mode, so you would know what to do.



However, if you're still adamant to use the idea of switching the keyboard app, then I suggest you take a look at my comments:

Delve into settings.db


  The table secure of settings.db (Settings Storage) has keys like default_input_method (Samsung/Swiftkey) and some related keys. Change their values using Tasker when your specific app is launched and you're good to go. 


Enable/Disable the app on-the-fly


  You can on-the-fly disable the SwiftKey when your specific app is launched, because when SwiftKey is disabled (i.e. not available), Android will tend to fall back to the available keyboard which would be the Samsung one. This technique can be achieved by Tasker, and while it's theoretical, I believe it would also work.