From fcb6095b9140296cf3b5a4af3107500ee943bacc Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 30 May 2012 09:45:28 -0700 Subject: Make sure focusSearch doesn't return a detached webview Bug: 6535227 Change-Id: I18bf24117d8ffcbbd440b2a47b2db422e41894f4 --- src/com/android/browser/TitleBar.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java index ffe5553..d3e8f7c 100644 --- a/src/com/android/browser/TitleBar.java +++ b/src/com/android/browser/TitleBar.java @@ -405,8 +405,10 @@ public class TitleBar extends RelativeLayout { @Override public View focusSearch(View focused, int dir) { - if (FOCUS_DOWN == dir && hasFocus()) { - return getCurrentWebView(); + WebView web = getCurrentWebView(); + if (FOCUS_DOWN == dir && hasFocus() + && web.hasFocusable() && web.getParent() != null) { + return web; } return super.focusSearch(focused, dir); } -- cgit v1.1