Clean up access of display content
- ActivityRecord and Task get their own display instead of from parent. Because the hierarchy should guarantee the display instances are the same. - Remove redundant getDisplay().mDisplayContent since there is no ActivityDisplay after hierarchy unifying. - Access mDisplayContent directly because WindowContainer#reparent, setParent, onDisplayChanged never pass null DisplayContent. Currently the only place that clears mDisplayContent is in Task#onParentChanged. So the nullity check of mDisplayContent only exists in Task or other level's onConfigurationChanged if it is called the first time when adding to parent without display. - The best practice of handling non-attached container might be to check at upper entry, e.g. ActivityRecord.isInStackLocked, or use WindowContainer#isAttached. Instead of checking the nullity of display content everywhere. Bug: 163976519 Test: WmTests Change-Id: Ibf6c1368cfeadcad63ad5040a6166d654b906275
Loading
Please register or sign in to comment