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
This commit is contained in:
Ming-Shin Lu
2020-04-15 23:49:40 +08:00
parent edb826c298
commit a0605a6bfd

View File

@@ -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))