summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-02-24 15:48:05 -0800
committerJohn Reck <jreck@google.com>2011-02-24 15:48:05 -0800
commite6bf4abbb12a83fc0256d98d9d5cb36ee326f1ce (patch)
tree6936aabb4106e79900c8152c075d88611bca2431
parent19d194a667ea64a14e32982e11b22fb30e8cf10e (diff)
downloadpackages_apps_Browser-e6bf4abbb12a83fc0256d98d9d5cb36ee326f1ce.zip
packages_apps_Browser-e6bf4abbb12a83fc0256d98d9d5cb36ee326f1ce.tar.gz
packages_apps_Browser-e6bf4abbb12a83fc0256d98d9d5cb36ee326f1ce.tar.bz2
Fix back long press behavior
Bug: 3486271 Change-Id: I49eb218670b4082b1fcf6daaab025ec7e0be6b8c
-rw-r--r--src/com/android/browser/BrowserActivity.java6
-rw-r--r--src/com/android/browser/Controller.java23
2 files changed, 20 insertions, 9 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8c38e59..3c025d2 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -253,6 +253,12 @@ public class BrowserActivity extends Activity {
}
@Override
+ public boolean onKeyLongPress(int keyCode, KeyEvent event) {
+ return mController.onKeyLongPress(keyCode, event) ||
+ super.onKeyLongPress(keyCode, event);
+ }
+
+ @Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
return mController.onKeyUp(keyCode, event) ||
super.onKeyUp(keyCode, event);
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index da98a1c..c1f1313 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2489,15 +2489,8 @@ public class Controller
return true;
case KeyEvent.KEYCODE_BACK:
if (!noModifiers) break;
- if (event.getRepeatCount() == 0) {
- event.startTracking();
- return true;
- } else if (mUi.showsWeb()
- && event.isLongPress()) {
- bookmarksOrHistoryPicker(true);
- return true;
- }
- break;
+ event.startTracking();
+ return true;
case KeyEvent.KEYCODE_DPAD_LEFT:
if (ctrl) {
webView.goBack();
@@ -2562,6 +2555,18 @@ public class Controller
return mUi.dispatchKey(keyCode, event);
}
+ boolean onKeyLongPress(int keyCode, KeyEvent event) {
+ switch(keyCode) {
+ case KeyEvent.KEYCODE_BACK:
+ if (mUi.showsWeb()) {
+ bookmarksOrHistoryPicker(true);
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
boolean onKeyUp(int keyCode, KeyEvent event) {
if (!event.hasNoModifiers()) return false;
switch(keyCode) {