Fix handling of ime activation

This commit is contained in:
Isaac Murchie
2014-07-02 09:58:27 -07:00
parent e53f49c706
commit 3ad294c621

View File

@@ -1112,11 +1112,9 @@ androidController.getActiveIMEEngine = function (cb) {
androidController.activateIMEEngine = function (imeId, cb) {
logger.debug('Attempting to activate IME \'' + imeId + '\'');
var pkg = imeId.split('/')[0];
logger.debug('Checking if package \'' + pkg + '\' is installed');
this.adb.isAppInstalled(pkg, function (err, installed) {
this.adb.availableIMEs(function (err, engines) {
if (err) return cb(err);
if (installed) {
if (engines.indexOf(imeId) !== -1) {
logger.debug('Found installed IME, attempting to activate.');
this.adb.enableIME(imeId, function (err) {
if (err) return cb(err);