diff options
author | Michael Kolb <kolby@google.com> | 2011-08-15 15:37:30 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-08-15 16:17:26 -0700 |
commit | 8a009498bfca64556c2082cbb32f68506d6962db (patch) | |
tree | 01bbdc884cbfcffba6addd77ca362dcc8772dcf4 /src/com | |
parent | c3af06776be83ba64a0d3549cb72ca6e5e7f03cd (diff) | |
download | packages_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.java | 19 | ||||
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 2 |
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); |