Skip to content

Commit ad804e3

Browse files
committed
Fix bug 5321195 - Starting WebView text selection with long press does
not invoke haptic feedback Change-Id: I6ba6b7e5b0ecedf721ab6d1bf87d7d2a92dc7200
1 parent e71ffeb commit ad804e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/java/android/webkit/WebView.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import android.util.EventLog;
6363
import android.util.Log;
6464
import android.view.Gravity;
65+
import android.view.HapticFeedbackConstants;
6566
import android.view.HardwareCanvas;
6667
import android.view.InputDevice;
6768
import android.view.KeyCharacterMap;
@@ -4252,7 +4253,11 @@ public boolean performLongClick() {
42524253
* click action, look for a word under the click. If one is found,
42534254
* animate the text selection into view.
42544255
* FIXME: no animation code yet */
4255-
return selectText();
4256+
final boolean isSelecting = selectText();
4257+
if (isSelecting) {
4258+
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
4259+
}
4260+
return isSelecting;
42564261
}
42574262

42584263
/**

0 commit comments

Comments
 (0)