fix SOX in clearFocus
http://b/issue?id=3373046
don't clear focus when already not focused
Change-Id: I8a445b84416c156a4f72196439502670ac57b177
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 8dc8663..2fd9d3d 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -302,7 +302,6 @@
i.putExtra(SearchManager.APP_DATA, appData);
}
mUiController.handleNewIntent(i);
- setUrlMode(false);
setDisplayTitle(text);
}
@@ -313,7 +312,6 @@
currentTab.getWebView().requestFocus();
}
mUi.hideFakeTitleBar();
- setUrlMode(false);
// if top != null current must be set
if ((currentTab != null) && !mInVoiceMode) {
setDisplayTitle(currentTab.getUrl());
@@ -345,7 +343,9 @@
mWebIcon.setImageResource(R.drawable.ic_search_holo_dark);
updateSearchMode();
} else {
- mUrlInput.clearFocus();
+ if (mUrlInput.hasFocus()) {
+ mUrlInput.clearFocus();
+ }
mGoButton.setVisibility(View.GONE);
mVoiceSearch.setVisibility(View.GONE);
mStar.setVisibility(View.VISIBLE);