Introduce IMM#setExplicitlyEnabledInputMethodSubtypes()
While it still makes sense to require a user consent when enabling non-system IMEs, programmatically modifying explicitly enabled subtypes can be allowed for each IME as long as affected subtypes are their own. This is why IMM#setExplicitlyEnabledInputMethodSubtypes(String, int[]) is introduced in this CL. Here are use cases for IME developers. * If they like, IME developers can take full control of what subtypes are explicitly enabled for their IME, with their own settings UI instead of relying on InputMethodManager#showInputMethodAndSubtypeEnabler() and user interactions. This also enables IME developers to backup and restore enabled subtypes in some cloud services. * If IME developers find that Settings.Secure.ENABLED_INPUT_METHODS contains any invalid subtype hashcode, or they plan to migrate some legacy subtype hashcode to a new subtype hashcode, they can programmatically fix/migrate it without bothering users. See also the corresponding end-to-end test in CTS [1]. [1]: I0d46efb1ec98aaf529e2d531205ccd2cc0261492 Fix: 249110888 Test: atest CtsInputMethodTestCases:InputMethodSubtypeTest Test: atest FrameworksServicesTests:InputMethodUtilsTest#updateEnabledImeStringTest Change-Id: I836903dbdb6bc1ff3dc4b99710e4e08a65f59417
Loading
Please register or sign in to comment