From 769f04c8f03a630f6cc69082169c9618fe7d4751 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Mon, 18 Oct 2021 09:39:50 +0000 Subject: [PATCH] Revert "Revert "Provide IconProvider in sysui dagger"" This reverts commit 289347aedf2c1494cb3f3f741e9b7eece5fa0e3a. Reason for revert: re-land the CL with CarLauncher change Merged-In: If4ab0590f4b850103411b6a2dccf2092bb06d563 Change-Id: I5a43908f958b45a936d0e7ac09f96d85d08663b7 --- .../startingsurface/SplashscreenContentDrawer.java | 4 ++-- .../shell/startingsurface/StartingSurfaceDrawer.java | 5 +++-- .../startingsurface/StartingWindowController.java | 7 +++++-- .../startingsurface/StartingSurfaceDrawerTests.java | 10 +++++++--- .../android/systemui/wmshell/WMShellBaseModule.java | 12 ++++++++++-- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java index 8df7cbb278071..b191cabcf6aa7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java @@ -110,9 +110,9 @@ public class SplashscreenContentDrawer { @VisibleForTesting final ColorCache mColorCache; - SplashscreenContentDrawer(Context context, TransactionPool pool) { + SplashscreenContentDrawer(Context context, IconProvider iconProvider, TransactionPool pool) { mContext = context; - mIconProvider = new IconProvider(context); + mIconProvider = iconProvider; mTransactionPool = pool; // Initialize Splashscreen worker thread diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java index 979bf0056b72b..bd4869670bec2 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java @@ -61,6 +61,7 @@ import android.window.TaskSnapshot; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; +import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.annotations.ShellSplashscreenThread; @@ -123,11 +124,11 @@ public class StartingSurfaceDrawer { * @param splashScreenExecutor The thread used to control add and remove starting window. */ public StartingSurfaceDrawer(Context context, ShellExecutor splashScreenExecutor, - TransactionPool pool) { + IconProvider iconProvider, TransactionPool pool) { mContext = context; mDisplayManager = mContext.getSystemService(DisplayManager.class); mSplashScreenExecutor = splashScreenExecutor; - mSplashscreenContentDrawer = new SplashscreenContentDrawer(mContext, pool); + mSplashscreenContentDrawer = new SplashscreenContentDrawer(mContext, iconProvider, pool); mSplashScreenExecutor.execute(() -> mChoreographer = Choreographer.getInstance()); mWindowManagerGlobal = WindowManagerGlobal.getInstance(); mDisplayManager.getDisplay(DEFAULT_DISPLAY); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java index 99644f9493d2c..a86e07a5602df 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java @@ -43,6 +43,7 @@ import androidx.annotation.BinderThread; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.function.TriConsumer; +import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.common.RemoteCallable; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TransactionPool; @@ -85,9 +86,11 @@ public class StartingWindowController implements RemoteCallable