Log the exception when the view couldn't get added
We are getting reports of a crash inside ViewRootImpl's InputStage.onDetachedFromWindow method, due to 'mFirstInputStage' object being null. The only way that could happen is if 'mAdded' is true, but an exception occurs sometime before 'mFirstInputStage' is assigned. The most likely caller of this location is WindowManagerGlobal. Inside WMG, there is a "try / catch" section. The actual exception is indeed getting rethrown. However, because it's java, it's hard to trace whether anyone else higher up is catching this exception. Therefore, simply null checking the mFirstInputStage might be just postponing this problem. If we are going to throw anyways, then it's likely that try / catch approach of WMG is not needed - we should just throw and not do the "removeViewLocked" code. In this CL, the proposal is to add a log of the exception as soon as it occurs, so that we can learn more about the problem. We can then make a more informed decision on how to handle it. Bug: 385705687 Flag: EXEMPT refactor Test: none Change-Id: I3d239bcd5b84710325d33fff86d99a4be9a8dc3f
Loading
Please register or sign in to comment