Don't create panel if content is empty
This CL fixes the issue where WM CTS is causing ANR in ARC. When a menu panel is opened, the sub window for this panel is created, but as it doesn't have any content, it's considered hidden by SF. The problem here is that as focus has already moved to this app at this point, InputDispatcher expects the window will get a content soon, but this never happens and causes ANR. So, the root problem here is that PhoneWindow creates a window with WRAP_CONTENT even if there's no content set to the window. This seems to be a pure bug in PhoneWindow because there's already some logic where if it doesn't have any menu item, it aborts opening a panel, but if this function is called twice, this return logic is bypassed and the window is accidentally created (because whether it goes thought the return logic depends on whether st.decorView has an instance, and this is instantiated in the first call of openPanel()) This CL ensures the sub window isn't created if there's no item to be shown. Bug: 180566381 Bug: 181543065 Test: atest CtsWindowManagerDeviceTestCases Change-Id: I1a1ae84abf4e4466ebb4a6655a5be007ee763d78
Loading
Please register or sign in to comment