Skip to content

Commit 605383f

Browse files
authored
chore: remove unused unicodeKeyboard as uia2 (#581)
1 parent a829766 commit 605383f

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

lib/commands/element.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ commands.setValueImmediate = async function (keys, elementId) {
6868
return await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
6969
elementId,
7070
text: _.isArray(keys) ? keys.join('') : keys,
71-
replace: false,
72-
unicodeKeyboard: this.opts.unicodeKeyboard,
71+
replace: false
7372
});
7473
};
7574

lib/driver.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class AndroidUiautomator2Driver extends BaseDriver {
163163
this.desiredCapConstraints = desiredCapConstraints;
164164
this.uiautomator2 = null;
165165
this.jwpProxyActive = false;
166-
this.defaultIME = null;
167166
this.jwpProxyAvoid = NO_PROXY;
168167
this.apkStrings = {}; // map of language -> strings obj
169168

@@ -388,7 +387,7 @@ class AndroidUiautomator2Driver extends BaseDriver {
388387

389388
// start an avd, set the language/locale, pick an emulator, etc...
390389
// TODO with multiple devices we'll need to parameterize this
391-
this.defaultIME = await helpers.initDevice(this.adb, this.opts);
390+
await helpers.initDevice(this.adb, this.opts);
392391

393392
// Prepare the device by forwarding the UiAutomator2 port
394393
// This call mutates this.opts.systemPort if it is not set explicitly
@@ -647,14 +646,6 @@ class AndroidUiautomator2Driver extends BaseDriver {
647646
})();
648647
}));
649648

650-
if (this.opts.unicodeKeyboard && this.opts.resetKeyboard && this.defaultIME) {
651-
this.log.debug(`Resetting IME to '${this.defaultIME}'`);
652-
try {
653-
await this.adb.setIME(this.defaultIME);
654-
} catch (err) {
655-
this.log.warn(`Unable to reset IME: ${err.message}`);
656-
}
657-
}
658649
if (this.caps.androidCoverage) {
659650
this.log.info('Shutting down the adb process of instrumentation...');
660651
await this.adb.endAndroidCoverage();

test/functional/commands/general/ime-e2e-specs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const unicodeImeId = 'io.appium.settings/.UnicodeIME';
1212
describe('apidemo - IME', function () {
1313
let driver;
1414
before(async function () {
15-
driver = await initSession(Object.assign({}, APIDEMOS_CAPS, {unicodeKeyboard: true, resetKeyboard: true}));
15+
driver = await initSession(Object.assign(APIDEMOS_CAPS));
1616
});
1717
beforeEach(async function () {
1818
await driver.startActivity({appPackage: 'io.appium.android.apis', appActivity: 'io.appium.android.apis.ApiDemos'});

test/functional/commands/keyboard/keyboard-e2e-specs.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ const defaultAsciiCaps = Object.assign({}, APIDEMOS_CAPS, {
2424
appActivity: TEXTFIELD_ACTIVITY
2525
});
2626

27-
const defaultUnicodeCaps = Object.assign({}, defaultAsciiCaps, {
28-
unicodeKeyboard: true,
29-
resetKeyboard: true
30-
});
27+
const defaultUnicodeCaps = defaultAsciiCaps;
3128

3229
async function ensureUnlocked (driver) {
3330
// on Travis the device is sometimes not unlocked

0 commit comments

Comments
 (0)