diff options
| author | 2020-08-14 13:48:53 +0800 | |
|---|---|---|
| committer | 2020-08-18 10:03:28 +0800 | |
| commit | 21a0fca709baf84c7e4883dcca09acc3b7b37bf5 (patch) | |
| tree | 372acbc5bdac7eb753743937e4bf80aab07471ed | |
| parent | fd2a63b467de5e61c29a9d9f36c3bb9509f74e25 (diff) | |
Decouple Injection of PipManager (6/N)
Let WindowManagerShellModule provides
DeviceConfigProxy, FloatingContentCoordinator, and PipUiEventLogger
instead of Inject throught PipManager constructor
Bug: 161118569
Test: make SystemUI
Test: make ArcSystemUI
Test: launch aosp_tv_arm-userdebug & make
Test: atest WindowManagerShellTests
Test: atest SystemUITests
Test: manual test Pip demo AP
Change-Id: Ib6c9dd8792bca931ce96898bae47767558225f74
4 files changed, 26 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/PipUiEventLogger.java b/packages/SystemUI/src/com/android/systemui/pip/PipUiEventLogger.java index 7ce2028b5f1b..8bcaa8ab5404 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/PipUiEventLogger.java +++ b/packages/SystemUI/src/com/android/systemui/pip/PipUiEventLogger.java @@ -22,9 +22,6 @@ import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.systemui.dagger.SysUISingleton; -import javax.inject.Inject; - - /** * Helper class that ends PiP log to UiEvent, see also go/uievent */ @@ -35,7 +32,6 @@ public class PipUiEventLogger { private TaskInfo mTaskInfo; - @Inject public PipUiEventLogger(UiEventLogger uiEventLogger) { mUiEventLogger = uiEventLogger; } diff --git a/packages/SystemUI/src/com/android/systemui/util/DeviceConfigProxy.java b/packages/SystemUI/src/com/android/systemui/util/DeviceConfigProxy.java index 3a2172ae0fae..66f8f74c7cab 100644 --- a/packages/SystemUI/src/com/android/systemui/util/DeviceConfigProxy.java +++ b/packages/SystemUI/src/com/android/systemui/util/DeviceConfigProxy.java @@ -25,13 +25,11 @@ import android.provider.Settings; import java.util.concurrent.Executor; -import javax.inject.Inject; - /** * Wrapper around DeviceConfig useful for testing. */ public class DeviceConfigProxy { - @Inject + public DeviceConfigProxy() { } diff --git a/packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt b/packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt index f22f59bee42f..bcfb2afeeda1 100644 --- a/packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt @@ -4,8 +4,7 @@ import android.graphics.Rect import android.util.Log import com.android.systemui.dagger.SysUISingleton import com.android.systemui.util.FloatingContentCoordinator.FloatingContent -import java.util.* -import javax.inject.Inject +import java.util.HashMap /** Tag for debug logging. */ private const val TAG = "FloatingCoordinator" @@ -20,9 +19,9 @@ private const val TAG = "FloatingCoordinator" * other content out of the way. [onContentRemoved] should be called when the content is removed or * no longer visible. */ -@SysUISingleton -class FloatingContentCoordinator @Inject constructor() { +@SysUISingleton +class FloatingContentCoordinator constructor() { /** * Represents a piece of floating content, such as PIP or the Bubbles stack. Provides methods * that allow the [FloatingContentCoordinator] to determine the current location of the content, diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java index ac47660f3221..34398cc79bd2 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java @@ -20,8 +20,12 @@ import android.content.Context; import android.os.Handler; import android.view.IWindowManager; +import com.android.internal.logging.UiEventLogger; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; +import com.android.systemui.pip.PipUiEventLogger; +import com.android.systemui.util.DeviceConfigProxy; +import com.android.systemui.util.FloatingContentCoordinator; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.SystemWindows; import com.android.wm.shell.common.TransactionPool; @@ -51,8 +55,26 @@ public class WMShellBaseModule { @SysUISingleton @Provides + static DeviceConfigProxy provideDeviceConfigProxy() { + return new DeviceConfigProxy(); + } + @SysUISingleton + @Provides + static FloatingContentCoordinator provideFloatingContentCoordinator() { + return new FloatingContentCoordinator(); + } + + @SysUISingleton + @Provides + static PipUiEventLogger providePipUiEventLogger(UiEventLogger uiEventLogger) { + return new PipUiEventLogger(uiEventLogger); + } + + @SysUISingleton + @Provides static SystemWindows provideSystemWindows(DisplayController displayController, IWindowManager wmService) { return new SystemWindows(displayController, wmService); } + } |