Shorten IME surface caching duration

Shorten IME surface caching so that we can avoid showing cached IME
surface when IME insets have changed from the last time it was shown.

Fix: 221458652
Bug: 230762351

Test: Manually using steps:
   1. Go to gboard settings and enable Emoji bar
   2. Open a chat in messages app
   3. tap editor and make sure Insets dont change after show
      animation completes.

Change-Id: I4c2a9c272ef0e7be7128ca64abebd3a3b7d2d7a4
This commit is contained in:
Taran Singh
2022-04-28 18:16:51 +00:00
parent c37d317e0c
commit 75ce82747d

View File

@@ -482,8 +482,9 @@ public class InputMethodService extends AbstractInputMethodService {
/**
* Timeout after which hidden IME surface will be removed from memory
* TODO(b/230762351): reset timeout to 5000ms and invalidate cache when IME insets change.
*/
private static final long TIMEOUT_SURFACE_REMOVAL_MILLIS = 5000;
private static final long TIMEOUT_SURFACE_REMOVAL_MILLIS = 500;
InputMethodManager mImm;
private InputMethodPrivilegedOperations mPrivOps = new InputMethodPrivilegedOperations();