summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-08-15 15:37:30 -0700
committerMichael Kolb <kolby@google.com>2011-08-15 16:17:26 -0700
commit8a009498bfca64556c2082cbb32f68506d6962db (patch)
tree01bbdc884cbfcffba6addd77ca362dcc8772dcf4 /src/com
parentc3af06776be83ba64a0d3549cb72ca6e5e7f03cd (diff)
downloadpackages_apps_Browser-8a009498bfca64556c2082cbb32f68506d6962db.zip
packages_apps_Browser-8a009498bfca64556c2082cbb32f68506d6962db.tar.gz
packages_apps_Browser-8a009498bfca64556c2082cbb32f68506d6962db.tar.bz2
Fix monkey bug
Bug: 5166733 added missing return statements and valid active tab check Change-Id: Ida7ffa6faf77a95eaf19ef566176ad522be4efef
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/Controller.java19
-rw-r--r--src/com/android/browser/PhoneUi.java2
2 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 3f126c0..24072c9 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2684,23 +2684,32 @@ public class Controller
}
public boolean dispatchKeyEvent(KeyEvent event) {
- return mBlockEvents;
+ return mBlockEvents || hasNoActiveTab();
}
public boolean dispatchKeyShortcutEvent(KeyEvent event) {
- return mBlockEvents;
+ return mBlockEvents || hasNoActiveTab();
}
public boolean dispatchTouchEvent(MotionEvent ev) {
- return mBlockEvents;
+ return mBlockEvents || hasNoActiveTab();
}
public boolean dispatchTrackballEvent(MotionEvent ev) {
- return mBlockEvents;
+ return mBlockEvents || hasNoActiveTab();
}
public boolean dispatchGenericMotionEvent(MotionEvent ev) {
- return mBlockEvents;
+ return mBlockEvents || hasNoActiveTab();
+ }
+
+ private boolean hasNoActiveTab() {
+ Tab tab = getCurrentTab();
+ if (tab == null) {
+ Log.w(LOGTAG, "Received event with no active tab. Tab count: "
+ + mTabControl.getTabCount());
+ }
+ return tab == null;
}
}
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index d77fcdb..23d7abb 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -329,10 +329,12 @@ public class PhoneUi extends BaseUi {
final Tab tab = mNavScreen.getSelectedTab();
if ((tab != null) && !animate) {
finishAnimateOut(tab);
+ return;
}
NavTabView tabview = (NavTabView) mNavScreen.getSelectedTabView();
if (tabview == null) {
finishAnimateOut(tab);
+ return;
}
mUiController.setBlockEvents(true);
mUiController.setActiveTab(tab);