From 73254be0ddfc075521a63a069c6c30d200dca557 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Fri, 7 Jan 2011 15:51:43 -0500 Subject: [PATCH] Do not update matches string when there are no matches. Bug:2927451 Change-Id: I6374ffcc9d0710d69206d2f1f31a908b010a75bf --- core/java/android/webkit/FindActionModeCallback.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java index 842f6c82036a1..700d313c8d4ee 100644 --- a/core/java/android/webkit/FindActionModeCallback.java +++ b/core/java/android/webkit/FindActionModeCallback.java @@ -143,6 +143,7 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher, /* * Update the string which tells the user how many matches were found, and * which match is currently highlighted. + * Not to be called when mNumberOfMatches is 0. */ private void updateMatchesString() { String template = mResources.getQuantityString( @@ -196,6 +197,11 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher, findAll(); return true; } + if (0 == mNumberOfMatches) { + // There are no matches, so moving to the next match will not do + // anything. + return true; + } switch(item.getItemId()) { case com.android.internal.R.id.find_prev: findNext(false);