From a0605a6bfdf411ead28c4c00eac28f773721c6ff Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Wed, 15 Apr 2020 23:49:40 +0800 Subject: [PATCH] Fix SoftInputShowHideHistory entry seq number representation The sequence number will be reset from 0 when calling dumpsys input_method. This increasing number should be stored into history Entry. Fix: 154115116 Test: Use `adb shell dumpsys input_method` command multple times, Observe if the sequence number of SoftInputShowHidHistory entry is increasing. Change-Id: Ic8c3afd8eb6748012edc860156c9f9aa78e2d4a6 --- .../android/server/inputmethod/InputMethodManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index e6cb37185d71d..b949d6bcf2e25 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -784,6 +784,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final AtomicInteger sSequenceNumber = new AtomicInteger(0); private static final class Entry { + final int mSequenceNumber = sSequenceNumber.getAndIncrement(); final ClientState mClientState; @SoftInputModeFlags final int mFocusedWindowSoftInputMode; @@ -831,7 +832,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub continue; } pw.print(prefix); - pw.println("SoftInputShowHideHistory #" + sSequenceNumber.getAndIncrement() + ":"); + pw.println("SoftInputShowHideHistory #" + entry.mSequenceNumber + ":"); pw.print(prefix); pw.println(" time=" + dataFormat.format(new Date(entry.mWallTime))