Add IMS#BACK_DISPOSITION_ADJUST_NOTHING
This is a follow up CL to our previous attempt [1] to make InputMethodService#setBackDisposition() work and make sense. Based on the feedback from several IME developers, we learned that InputMethodService#setBackDisposition() is still confusing. My conclusion is that trying to reuse existing flags was a mistake. Here are the rationale for deprecating those two flags. * BACK_DISPOSITION_WILL_NOT_DISMISS This flag had never been used until we started using it in our previous CL [1]. However, it turns out that what this flag means is hard to understand because its JavaDoc only says "This input method will not consume the back key." To address the original goal of Bug 38513361, we can (and should) introduce a new flag rather than reusing this confusing flag. Deprecating this flag should have no impact because it had never been used. * BACK_DISPOSITION_WILL_DISMISS On pre-P devices IME could abuse this flag to override the back button to "dismiss" mode even after IME lost the focus. On the other hand, as far as we know there is no good use case for this flag. Hence rather than trying to fix such an abuse scenario, we should just deprecate this flag. Instead, a newly introduced flag BACK_DISPOSITION_ADJUST_NOTHING should be sufficient to achieve the original goal of Bug 38513361. This flag does not rely on the concept "dismiss" and key event handling hence it would be much easier to maintain. [1]: I99e7c413fe1a93f8d8cff897b5c5f0947690d2c0 3fecef11 Fix: 74403102 Test: atest CtsInputMethodTestCases Change-Id: I064209c40da79fffb2627e8f580818a793017b1f
Loading
Please register or sign in to comment