Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a8f422a authored by Gaurav Bhola's avatar Gaurav Bhola
Browse files

Add TS flag to control auto task stack controller in WMShell

- The AutoTaskStackController used the flag from Car namespace, which 
  isn't right given the gantry flow for automotive might be different with
  different rules and regulations.
- Instead put the TS flag in wmshell itself.

Change-Id: I8edc2b9e9efa34402da2bb7cca15a3ae647266fa
Flag: com.android.wm.shell.enable_auto_task_stack_controller
Bug: 384082238 
Test: make
parent a68d78d7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ android_library {
    static_libs: [
        "//frameworks/libs/systemui:com_android_systemui_shared_flags_lib",
        "//frameworks/libs/systemui:iconloader_base",
        "//packages/apps/Car/SystemUI/aconfig:com_android_systemui_car_flags_lib",
        "PlatformAnimationLib",
        "WindowManager-Shell-lite-proto",
        "WindowManager-Shell-proto",
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ aconfig_declarations {
    container: "system",
    srcs: [
        "multitasking.aconfig",
        "automotive.aconfig",
    ],
}

+11 −0
Original line number Diff line number Diff line
# proto-file: build/make/tools/aconfig/aconfig_protos/protos/aconfig.proto

package: "com.android.wm.shell"
container: "system"

flag {
    name: "enable_auto_task_stack_controller"
    namespace: "multitasking"
    description: "Enables auto task stack controller to manage task stacks on automotive"
    bug: "384082238"
}
+5 −5
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ import android.view.WindowManager.TRANSIT_CHANGE
import android.window.TransitionInfo
import android.window.TransitionRequestInfo
import android.window.WindowContainerTransaction
import com.android.systemui.car.Flags.autoTaskStackWindowing
import com.android.wm.shell.Flags.enableAutoTaskStackController
import com.android.wm.shell.RootTaskDisplayAreaOrganizer
import com.android.wm.shell.ShellTaskOrganizer
import com.android.wm.shell.common.ShellExecutor
@@ -66,7 +66,7 @@ class AutoTaskStackControllerImpl @Inject constructor(
    private val defaultRootTaskPerDisplay = mutableMapOf<Int, Int>()

    init {
        if (!autoTaskStackWindowing()) {
        if (!enableAutoTaskStackController()) {
            throw IllegalStateException("Failed to initialize" +
                    "AutoTaskStackController as the auto_task_stack_windowing TS flag is disabled.")
        } else {
@@ -220,7 +220,7 @@ class AutoTaskStackControllerImpl @Inject constructor(
        displayId: Int,
        listener: RootTaskStackListener
    ) {
        if (!autoTaskStackWindowing()) {
        if (!enableAutoTaskStackController()) {
            Slog.e(
                TAG, "Failed to create root task stack as the " +
                        "auto_task_stack_windowing TS flag is disabled."
@@ -236,7 +236,7 @@ class AutoTaskStackControllerImpl @Inject constructor(
    }

    override fun setDefaultRootTaskStackOnDisplay(displayId: Int, rootTaskStackId: Int?) {
        if (!autoTaskStackWindowing()) {
        if (!enableAutoTaskStackController()) {
            Slog.e(
                TAG, "Failed to set default root task stack as the " +
                        "auto_task_stack_windowing TS flag is disabled."
@@ -280,7 +280,7 @@ class AutoTaskStackControllerImpl @Inject constructor(
    }

    override fun startTransition(transaction: AutoTaskStackTransaction): IBinder? {
        if (!autoTaskStackWindowing()) {
        if (!enableAutoTaskStackController()) {
            Slog.e(
                TAG, "Failed to start transaction as the " +
                        "auto_task_stack_windowing TS flag is disabled."