Moved "cordova.getThreadPool().execute(..." into the switch statement to avoid double checking the action parameter.