Merge "Revert^2 "Revert "Provide IconProvider in sysui dagger""" into sc-v2-dev

This commit is contained in:
Michał Brzeziński
2021-10-19 14:50:22 +00:00
committed by Android (Google) Code Review
5 changed files with 11 additions and 27 deletions

View File

@@ -110,9 +110,9 @@ public class SplashscreenContentDrawer {
@VisibleForTesting @VisibleForTesting
final ColorCache mColorCache; final ColorCache mColorCache;
SplashscreenContentDrawer(Context context, IconProvider iconProvider, TransactionPool pool) { SplashscreenContentDrawer(Context context, TransactionPool pool) {
mContext = context; mContext = context;
mIconProvider = iconProvider; mIconProvider = new IconProvider(context);
mTransactionPool = pool; mTransactionPool = pool;
// Initialize Splashscreen worker thread // Initialize Splashscreen worker thread

View File

@@ -61,7 +61,6 @@ import android.window.TaskSnapshot;
import com.android.internal.R; import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting; 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.ShellExecutor;
import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.TransactionPool;
import com.android.wm.shell.common.annotations.ShellSplashscreenThread; import com.android.wm.shell.common.annotations.ShellSplashscreenThread;
@@ -124,11 +123,11 @@ public class StartingSurfaceDrawer {
* @param splashScreenExecutor The thread used to control add and remove starting window. * @param splashScreenExecutor The thread used to control add and remove starting window.
*/ */
public StartingSurfaceDrawer(Context context, ShellExecutor splashScreenExecutor, public StartingSurfaceDrawer(Context context, ShellExecutor splashScreenExecutor,
IconProvider iconProvider, TransactionPool pool) { TransactionPool pool) {
mContext = context; mContext = context;
mDisplayManager = mContext.getSystemService(DisplayManager.class); mDisplayManager = mContext.getSystemService(DisplayManager.class);
mSplashScreenExecutor = splashScreenExecutor; mSplashScreenExecutor = splashScreenExecutor;
mSplashscreenContentDrawer = new SplashscreenContentDrawer(mContext, iconProvider, pool); mSplashscreenContentDrawer = new SplashscreenContentDrawer(mContext, pool);
mSplashScreenExecutor.execute(() -> mChoreographer = Choreographer.getInstance()); mSplashScreenExecutor.execute(() -> mChoreographer = Choreographer.getInstance());
mWindowManagerGlobal = WindowManagerGlobal.getInstance(); mWindowManagerGlobal = WindowManagerGlobal.getInstance();
mDisplayManager.getDisplay(DEFAULT_DISPLAY); mDisplayManager.getDisplay(DEFAULT_DISPLAY);

View File

@@ -43,7 +43,6 @@ import androidx.annotation.BinderThread;
import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.function.TriConsumer; 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.RemoteCallable;
import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.TransactionPool;
@@ -86,11 +85,9 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
private final SparseIntArray mTaskBackgroundColors = new SparseIntArray(); private final SparseIntArray mTaskBackgroundColors = new SparseIntArray();
public StartingWindowController(Context context, ShellExecutor splashScreenExecutor, public StartingWindowController(Context context, ShellExecutor splashScreenExecutor,
StartingWindowTypeAlgorithm startingWindowTypeAlgorithm, IconProvider iconProvider, StartingWindowTypeAlgorithm startingWindowTypeAlgorithm, TransactionPool pool) {
TransactionPool pool) {
mContext = context; mContext = context;
mStartingSurfaceDrawer = new StartingSurfaceDrawer(context, splashScreenExecutor, mStartingSurfaceDrawer = new StartingSurfaceDrawer(context, splashScreenExecutor, pool);
iconProvider, pool);
mStartingWindowTypeAlgorithm = startingWindowTypeAlgorithm; mStartingWindowTypeAlgorithm = startingWindowTypeAlgorithm;
mSplashScreenExecutor = splashScreenExecutor; mSplashScreenExecutor = splashScreenExecutor;
} }

View File

@@ -69,7 +69,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest; import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.common.HandlerExecutor; import com.android.wm.shell.common.HandlerExecutor;
import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TransactionPool; import com.android.wm.shell.common.TransactionPool;
@@ -94,8 +93,6 @@ public class StartingSurfaceDrawerTests {
@Mock @Mock
private WindowManager mMockWindowManager; private WindowManager mMockWindowManager;
@Mock @Mock
private IconProvider mIconProvider;
@Mock
private TransactionPool mTransactionPool; private TransactionPool mTransactionPool;
private final Handler mTestHandler = new Handler(Looper.getMainLooper()); private final Handler mTestHandler = new Handler(Looper.getMainLooper());
@@ -108,8 +105,8 @@ public class StartingSurfaceDrawerTests {
int mAddWindowForTask = 0; int mAddWindowForTask = 0;
TestStartingSurfaceDrawer(Context context, ShellExecutor splashScreenExecutor, TestStartingSurfaceDrawer(Context context, ShellExecutor splashScreenExecutor,
IconProvider iconProvider, TransactionPool pool) { TransactionPool pool) {
super(context, splashScreenExecutor, iconProvider, pool); super(context, splashScreenExecutor, pool);
} }
@Override @Override
@@ -159,8 +156,7 @@ public class StartingSurfaceDrawerTests {
doNothing().when(mMockWindowManager).addView(any(), any()); doNothing().when(mMockWindowManager).addView(any(), any());
mTestExecutor = new HandlerExecutor(mTestHandler); mTestExecutor = new HandlerExecutor(mTestHandler);
mStartingSurfaceDrawer = spy( mStartingSurfaceDrawer = spy(
new TestStartingSurfaceDrawer(mTestContext, mTestExecutor, mIconProvider, new TestStartingSurfaceDrawer(mTestContext, mTestExecutor, mTransactionPool));
mTransactionPool));
} }
@Test @Test

View File

@@ -26,7 +26,6 @@ import android.view.WindowManager;
import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLogger;
import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.IStatusBarService;
import com.android.launcher3.icons.IconProvider;
import com.android.systemui.dagger.WMComponent; import com.android.systemui.dagger.WMComponent;
import com.android.systemui.dagger.WMSingleton; import com.android.systemui.dagger.WMSingleton;
import com.android.wm.shell.RootDisplayAreaOrganizer; import com.android.wm.shell.RootDisplayAreaOrganizer;
@@ -170,12 +169,6 @@ public abstract class WMShellBaseModule {
return new SystemWindows(displayController, wmService); return new SystemWindows(displayController, wmService);
} }
@WMSingleton
@Provides
static IconProvider provideIconProvider(Context context) {
return new IconProvider(context);
}
// We currently dedupe multiple messages, so we use the shell main handler directly // We currently dedupe multiple messages, so we use the shell main handler directly
@WMSingleton @WMSingleton
@Provides @Provides
@@ -511,10 +504,9 @@ public abstract class WMShellBaseModule {
@Provides @Provides
static StartingWindowController provideStartingWindowController(Context context, static StartingWindowController provideStartingWindowController(Context context,
@ShellSplashscreenThread ShellExecutor splashScreenExecutor, @ShellSplashscreenThread ShellExecutor splashScreenExecutor,
StartingWindowTypeAlgorithm startingWindowTypeAlgorithm, IconProvider iconProvider, StartingWindowTypeAlgorithm startingWindowTypeAlgorithm, TransactionPool pool) {
TransactionPool pool) {
return new StartingWindowController(context, splashScreenExecutor, return new StartingWindowController(context, splashScreenExecutor,
startingWindowTypeAlgorithm, iconProvider, pool); startingWindowTypeAlgorithm, pool);
} }
// //