Add HIDE_REMOVE_CLIENT into InputMethodDebug

CL [1] introduced the HIDE_REMOVE_CLIENT reason in
SoftInputShowHideReason.

Add this reason into InputMethodDebug to avoid dump
unknown reason unexpectedly.

[1]: Ifb91111f7136952462678ff6d0a5e917abb5005e

Bug: 167780081
Test: atest InputMethodDebugTest
Change-Id: I23a8deea66600e3e31bdcb5fbf8fb87d91c57e4d
This commit is contained in:
Wilson Wu
2020-12-30 16:25:25 +08:00
parent 1346575ebc
commit 1778037875
2 changed files with 10 additions and 0 deletions

View File

@@ -226,6 +226,8 @@ public final class InputMethodDebug {
return "HIDE_RECENTS_ANIMATION";
case SoftInputShowHideReason.HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR:
return "HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR";
case SoftInputShowHideReason.HIDE_REMOVE_CLIENT:
return "HIDE_REMOVE_CLIENT";
default:
return "Unknown=" + reason;
}

View File

@@ -65,4 +65,12 @@ public class InputMethodDebugTest {
InputMethodDebug.startInputFlagsToString(
StartInputFlags.VIEW_HAS_FOCUS | StartInputFlags.INITIAL_CONNECTION));
}
@Test
public void testSoftInputDisplayReasonToString() {
// TODO: add more tests
assertEquals("HIDE_REMOVE_CLIENT",
InputMethodDebug.softInputDisplayReasonToString(
SoftInputShowHideReason.HIDE_REMOVE_CLIENT));
}
}