SearchActivity widget crashes because Omnibox suggestions cannot find root view via ViewUtils |
||
Issue descriptionCaused by: https://codereview.chromium.org/2849283002 05-02 00:25:31.760 11940 11940 E AndroidRuntime: java.lang.ClassCastException: android.view.ViewRootImpl cannot be cast to android.view.View 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.util.ViewUtils.getRelativeLayoutPosition(ViewUtils.java:74) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView$SuggestionContentsContainer.getUrlBarLeftOffset(SuggestionView.java:867) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView$SuggestionContentsContainer.getSuggestionTextLeftPosition(SuggestionView.java:881) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView$SuggestionContentsContainer.invalidate(SuggestionView.java:954) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView$SuggestionContentsContainer.setSuggestionIcon(SuggestionView.java:1017) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView$SuggestionContentsContainer.access$600(SuggestionView.java:620) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.SuggestionView.init(SuggestionView.java:344) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.getView(OmniboxResultsAdapter.java:64) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at android.widget.ListView.makeAndAddView(ListView.java:1790) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at android.widget.ListView.fillSpecific(ListView.java:1337) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at android.widget.ListView.layoutChildren(ListView.java:1620) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at org.chromium.chrome.browser.omnibox.LocationBarLayout$OmniboxSuggestionsList.layoutChildren(LocationBarLayout.java:632) 05-02 00:25:31.760 11940 11940 E AndroidRuntime: at android.widget.AbsListView.onLayout(AbsListView.java:2087) Not sure what the correct fix is here because the function explicitly states that it must be a child of the root view, and a findViewById(R.id.content) is obviously failing for the omnibox results in SearchActivity. If you output the ancestor chain in ViewUtils, you get a root view of "null" for the UrlBar, so I'm guessing R.id.content is completely missing. 05-02 00:50:39.160 15763 15763 E cr_dfalcantara: Called: null, org.chromium.chrome.browser.omnibox.UrlBar{42baeab0 VFED..CL .F....I. 0,51-912,116 #7f0f019f app:id/url_bar} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: org.chromium.chrome.browser.searchwidget.SearchActivityLocationBarLayout{42bbcb30 V.E..... ......I. 48,0-1056,168 #7f0f031d app:id/search_location_bar} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.FrameLayout{42bb4510 V.E...C. ......I. 0,0-1080,168 #7f0f014e app:id/toolbar} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.FrameLayout{42b5d3c8 V.E...C. ......ID 0,0-1080,1086 #7f0f015d app:id/control_container} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.support.v7.widget.ContentFrameLayout{42b3fce0 V.E..... ......ID 0,0-1080,1086 #1020002 android:id/content} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.support.v7.widget.FitWindowsLinearLayout{42b3e5f0 V.E..... ......ID 0,0-1080,1086 #7f0f00e3 app:id/action_bar_root} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.FrameLayout{42bad578 V.E..... ......ID 0,75-1080,1161} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.LinearLayout{42b5ebf0 V.E..... ......ID 0,0-1080,1776} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: com.android.internal.policy.impl.PhoneWindow$DecorView{42b5e070 V.E..... R.....ID 0,0-1080,1776} 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.view.ViewRootImpl@42b42918 05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent is wrong type: null, com.android.internal.policy.impl.PhoneWindow$DecorView{42b5e070 V.E..... R.....ID 0,0-1080,1776}, android.view.ViewRootImpl@42b42918
,
May 2 2017
The getRootView().findViewById(android.R.id.content) call is returning null, so getRootView() is somehow not able to find it? Bizarre.
,
May 2 2017
Maybe it's just not attached to the window when this is called yet? The same call seems to be succeeding later on.
05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Called: android.support.v7.widget.ContentFrameLayout{42b3fce0 V.E..... ......ID 0,0-1080,1086 #1020002 android:id/content}, org.chromium.chrome.browser.omnibox.UrlBar{42baeab0 VFED..CL .F....I. 0,51-912,116 #7f0f019f app:id/url_bar}
05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: org.chromium.chrome.browser.searchwidget.SearchActivityLocationBarLayout{42bbcb30 V.E..... ......I. 48,0-1056,168 #7f0f031d app:id/search_location_bar}
05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.FrameLayout{42bb4510 V.E...C. ......I. 0,0-1080,168 #7f0f014e app:id/toolbar}
05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.widget.FrameLayout{42b5d3c8 V.E...C. ......ID 0,0-1080,1086 #7f0f015d app:id/control_container}
05-02 00:50:39.170 15763 15763 E cr_dfalcantara: Parent: android.support.v7.widget.ContentFrameLayout{42b3fce0 V.E..... ......ID 0,0-1080,1086 #1020002 android:id/content}
,
May 2 2017
Issue 717408 has been merged into this issue.
,
May 2 2017
Its Blocking our Dev push, Can you please look in to this, Thanks!
,
May 2 2017
This issue is reproducible on tablets with below steps: 1.Launch Chrome> Tap on omnibox and try to type anything on keyboard 2.Observe Steps for Mobile Devices: Add ‘Google Search’ Widget on device home screen and then tap on it Observe Number of times you were able to reproduce: 5/5 Please find logs and Video @ http://go/chrome-androidlogs1/7/716351
,
May 2 2017
I reverted the CL last night; it should be alright once the next build happens.
,
May 2 2017
Verified this issue on Tablet(Pixel C) and Phone (Zenfone 2-(Z00AD) with 60.0.3087.3 build
,
May 8 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by dfalcant...@chromium.org
, May 2 2017