Let MockIme behave the same even w/ hard keyboard
This is a follow up CL to my previous CLs [1][2] that do not pass when
a hardware keyboard is attached.
Those tests fail because MockIme#onStartInputView() was not called,
which is because the default implementation of
InputMethodService#onEvaluateInputViewShown() returns false when
neither of the following conditions is true.
* Configuration#keyboard is KEYBOARD_NOKEYS
* Configuration#hardKeyboardHidden is HARDKEYBOARDHIDDEN_YES
Like we by default disable fullscreen mode in MockIme for the
convenience of writing tests, this CL also cancels the above default
behavior in case the device to be tested has hardware keyboard.
Tests that require the original behavior of InputMethodService can
still opt out this behavior overrides as follows.
try(MockImeSession imeSession = MockImeSession.create(
context, uiautomation, new ImeSettings.Builder()
.setHardKeyboardConfigurationBehaviorAllowed(true))) {
// Run test here
}
[1]: I0005aee0259f25c96fb94054535dd945a56e8cfb
6ff19b02ae5aa75f595a0ebd073b641d6edebf89
[2]: Ib265c6655468ec4788e360523e9f0c29447e1ecf
3612f05c8f4dddbf11f4a5c7a7fd9059699ee44b
Fix: 71050235
Test: atest CtsInputMethodTestCases
succeeds with and without a hardware keyboard attached.
Change-Id: I463bb4e9ae665b93950d664e0704ca4e938d32a8
2 files changed