Prepare SysUI Builder before building it.

Some SysUI sub-classes run more preparation work, so run that before
actually building SysUI.

Bug: 171437275
Bug: 171436765
Bug: 171837859
Test: Boot OEM devices that require preparation, boots correctly
Change-Id: I7b83d83e38501ef531ef1b272738b21c6d2496a2
This commit is contained in:
Ben Lin
2020-10-27 16:58:50 -07:00
parent bae149c2a8
commit 707c9334b2

View File

@@ -101,11 +101,13 @@ public class SystemUIFactory {
if (initializeComponents) {
// Only initialize when not starting from tests since this currently initializes some
// components that shouldn't be run in the test environment
builder = builder.setPip(mWMComponent.getPip())
builder = prepareSysUIComponentBuilder(builder, mWMComponent)
.setPip(mWMComponent.getPip())
.setSplitScreen(mWMComponent.getSplitScreen())
.setOneHanded(mWMComponent.getOneHanded())
.setShellDump(mWMComponent.getShellDump());
} else {
// TODO: Call on prepareSysUIComponentBuilder but not with real components.
builder = builder.setPip(Optional.ofNullable(null))
.setSplitScreen(Optional.ofNullable(null))
.setOneHanded(Optional.ofNullable(null))