Integrate Setup Wizard

In advanced windowing, the home scene is comprised of multiple, concurrently visible, and interactive app panels instead of a specific home activity. Advanced windowing uses a blank version of a home activity to be a visibility barrier for multi-window tasks.

Though Setup Wizard (SUW) is often treated as a home task, we recommend you configure SUW as part of a panel to create more consistent and reliable Home experiences.

Configure the home visibility barrier

Confirm that the home visibility barrier activity is a direct boot aware home activity that has a higher priority for the home intent filter than the SUW activity.

To learn more, see the reference platform in the StubCarLauncher package. We recommend you include this package in your builds and install it for all users.

Configure the SUW panel

We recommend placing SUW in a dedicated panel to handle unique conditions and to allow for dedicated placement outside the default root task You can configure the bounds and layering of this panel.

So that SUW is not obstructed from view, we recommend you place the SUW in a relatively high layer. This panel must show and hide the system events of _System_EnterSuwEvent and _System_ExitSuwEvent, respectively. Consider this sample configuration:

<TaskPanel id="suw_panel" defaultVariant="@id/closed" displayId="0" controller="@xml/suw_panel_controller">
    <TaskBehavior newTaskLaunchPolicy="REPARENT_TO_SOURCE"/>
    <Variant id="@+id/base">
        <Layer layer="@integer/suw_panel_layer"/>
        <Bounds left="0" top="0" width="100%" height="100%" />
        <Background color="@color/suw_panel_background_color" />
    </Variant>
    <Variant id="@+id/opened" parent="@id/base">
        <Visibility isVisible="true"/>
    </Variant>
    <Variant id="@+id/closed" parent="@id/base">
        <Visibility isVisible="false"/>
    </Variant>

    <Transitions>
        <Transition onEvent="_System_TaskOpenEvent" onEventTokens="panelId=suw_panel" toVariant="@id/opened"/>
        <Transition onEvent="_System_TaskPanelEmptyEvent" onEventTokens="panelId=suw_panel" toVariant="@id/closed"/>
        <Transition onEvent="_System_EnterSuwEvent" toVariant="@id/opened"/>
        <Transition onEvent="_System_ExitSuwEvent" toVariant="@id/closed"/>
    </Transitions>
</TaskPanel>

...

<Controller id="suw_panel_controller">
    <ControllerName>
        com.android.systemui.car.wm.scalableui.panel.controller.SetupPanelController
    </ControllerName>
    <PersistentPackage>com.android.car.mysetuppackage</PersistentPackage>
</Controller>

To align with the typical SUW app, if the SUW panel becomes invisible when setup is in progress, the controller sends an explicit home signal to the SUW activity to announce that SUW is concealed.

This addresses instances in which SUW knew the user was attempting to hide SUW by consuming the home intent but without having access to the home signal from the system.

If you have different expectations for your SUW design, you can implement the preferred behavior by replacing SetupPanelController with a custom controller.