diff --git a/java/src/com/android/inputmethod/latin/InputPointers.java b/java/src/com/android/inputmethod/latin/InputPointers.java
index c3bcf37..47bc6b0 100644
--- a/java/src/com/android/inputmethod/latin/InputPointers.java
+++ b/java/src/com/android/inputmethod/latin/InputPointers.java
@@ -17,6 +17,7 @@
 package com.android.inputmethod.latin;
 
 import android.util.Log;
+import android.util.SparseIntArray;
 
 import com.android.inputmethod.annotations.UsedForTesting;
 import com.android.inputmethod.latin.utils.ResizableIntArray;
@@ -160,15 +161,21 @@
 
     private boolean isValidTimeStamps() {
         final int[] times = mTimes.getPrimitiveArray();
+        final int[] pointerIds = mPointerIds.getPrimitiveArray();
+        final SparseIntArray lastTimeOfPointers = new SparseIntArray();
         final int size = getPointerSize();
-        for (int i = 1; i < size; ++i) {
-            if (times[i] < times[i - 1]) {
+        for (int i = 0; i < size; ++i) {
+            final int pointerId = pointerIds[i];
+            final int time = times[i];
+            final int lastTime = lastTimeOfPointers.get(pointerId, time);
+            if (time < lastTime) {
                 // dump
                 for (int j = 0; j < size; ++j) {
                     Log.d(TAG, "--- (" + j + ") " + times[j]);
                 }
                 return false;
             }
+            lastTimeOfPointers.put(pointerId, time);
         }
         return true;
     }
diff --git a/tools/dicttool/compat/android/util/SparseIntArray.java b/tools/dicttool/compat/android/util/SparseIntArray.java
new file mode 100644
index 0000000..ac8a04c
--- /dev/null
+++ b/tools/dicttool/compat/android/util/SparseIntArray.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+public class SparseIntArray {
+    private final SparseArray<Integer> mArray;
+
+    public SparseIntArray() {
+        this(10);
+    }
+
+    public SparseIntArray(final int initialCapacity) {
+        mArray = new SparseArray<Integer>(initialCapacity);
+    }
+
+    public int size() {
+        return mArray.size();
+    }
+
+    public void clear() {
+        mArray.clear();
+    }
+
+    public void put(final int key, final int value) {
+        mArray.put(key, value);
+    }
+
+    public int get(final int key) {
+        return get(key, 0);
+    }
+
+    public int get(final int key, final int valueIfKeyNotFound) {
+        return mArray.get(key, valueIfKeyNotFound);
+    }
+
+    public int indexOfKey(final int key) {
+        return mArray.indexOfKey(key);
+    }
+
+    public int keyAt(final int index) {
+        return mArray.keyAt(index);
+    }
+}
