summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2022-09-30 03:05:35 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-09-30 03:05:35 +0000
commit94bd703e56c4cd80d4adb3553c448005e813db28 (patch)
treeda182c95f2333d84a062c894a0f4a633bbd088fb
parentbe74f343db4c7ac096173c92871aee68a18c2ace (diff)
parent2da6ee0d2784a7b0a8c7b40c024c654de29aaef2 (diff)
Merge "Add config for registering shell task organizer" into tm-qpr-dev
-rw-r--r--libs/WindowManager/Shell/res/values/config.xml4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java6
2 files changed, 10 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/res/values/config.xml b/libs/WindowManager/Shell/res/values/config.xml
index f03b7f66cdc8..30c3d50ed8ad 100644
--- a/libs/WindowManager/Shell/res/values/config.xml
+++ b/libs/WindowManager/Shell/res/values/config.xml
@@ -19,6 +19,10 @@
by the resources of the app using the Shell library. -->
<bool name="config_enableShellMainThread">false</bool>
+ <!-- Determines whether to register the shell task organizer on init.
+ TODO(b/238217847): This config is temporary until we refactor the base WMComponent. -->
+ <bool name="config_registerShellTaskOrganizerOnInit">true</bool>
+
<!-- Animation duration for PIP when entering. -->
<integer name="config_pipEnterAnimationDuration">425</integer>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
index 80cdd1f79cb5..c25bbbf06dda 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
@@ -29,6 +29,7 @@ import android.view.WindowManager;
import com.android.internal.logging.UiEventLogger;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.ProtoLogController;
+import com.android.wm.shell.R;
import com.android.wm.shell.RootDisplayAreaOrganizer;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.ShellTaskOrganizer;
@@ -173,6 +174,7 @@ public abstract class WMShellBaseModule {
@WMSingleton
@Provides
static ShellTaskOrganizer provideShellTaskOrganizer(
+ Context context,
ShellInit shellInit,
ShellCommandHandler shellCommandHandler,
CompatUIController compatUI,
@@ -180,6 +182,10 @@ public abstract class WMShellBaseModule {
Optional<RecentTasksController> recentTasksOptional,
@ShellMainThread ShellExecutor mainExecutor
) {
+ if (!context.getResources().getBoolean(R.bool.config_registerShellTaskOrganizerOnInit)) {
+ // TODO(b/238217847): Force override shell init if registration is disabled
+ shellInit = new ShellInit(mainExecutor);
+ }
return new ShellTaskOrganizer(shellInit, shellCommandHandler, compatUI,
unfoldAnimationController, recentTasksOptional, mainExecutor);
}