Files
brave-core/browser/ui/android
Serg 8ced933b72 [Android] Fix crash in search widget when native library not loaded (#35458)
The upstream Chromium change
https://chromium-review.googlesource.com/c/chromium/src/+/7567418
("Clean up LocationBar focus and UrlBar management") in cr147 added a
setUrlBarFocus() call in SearchActivity.beginQuery(). This triggers the
omnibox suggestion pipeline (serveCachedZeroSuggest ->
buildDropdownViewInfoList) before native libraries are loaded.

BraveDropdownItemViewInfoListBuilder.isBraveLeoEnabled() and
isBraveSearchPromoBanner() both call ChromeFeatureList.isEnabled() which
requires native, causing UnsatisfiedLinkError on release builds and
AssertionError on debug builds.

Fix: reorder the && conditions to check tab != null before any native
calls. Since there's no tab in SearchActivity, the cheap null check
short-circuits and avoids the native call entirely. No functional
change - these features were never shown in the search widget context.

Resolves: https://github.com/brave/brave-browser/issues/54444
2026-04-13 18:32:16 +00:00
..