diff options
author | 2023-07-28 14:35:36 +0000 | |
---|---|---|
committer | 2023-07-28 14:35:36 +0000 | |
commit | 1884d55d52c7dd30959543bdfdec5a519258fd02 (patch) | |
tree | 134a88323cd2aab1b6fdf103c98aafcc666c6187 | |
parent | e82a295106343e5322317c5f191474ac4735e1a5 (diff) | |
parent | 7c7a4f13da1ca9723d9518192aa7b789f150e805 (diff) |
Merge "Fix multiple bindings to TouchInsetManager" into udc-qpr-dev
3 files changed, 15 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java index 553405f2c944..5577cbcb0dd7 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java @@ -17,6 +17,7 @@ package com.android.systemui.dreams; import static com.android.systemui.dreams.dagger.DreamModule.DREAM_OVERLAY_WINDOW_TITLE; +import static com.android.systemui.dreams.dagger.DreamModule.DREAM_TOUCH_INSET_MANAGER; import android.content.ComponentName; import android.content.Context; @@ -161,7 +162,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ DreamOverlayStateController stateController, KeyguardUpdateMonitor keyguardUpdateMonitor, UiEventLogger uiEventLogger, - TouchInsetManager touchInsetManager, + @Named(DREAM_TOUCH_INSET_MANAGER) TouchInsetManager touchInsetManager, @Nullable @Named(LowLightDreamModule.LOW_LIGHT_DREAM_COMPONENT) ComponentName lowLightDreamComponent, DreamOverlayCallbackController dreamOverlayCallbackController, diff --git a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java index c61b47758ab7..4bafe325cda0 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java @@ -31,11 +31,13 @@ import com.android.systemui.dreams.DreamOverlayNotificationCountProvider; import com.android.systemui.dreams.DreamOverlayService; import com.android.systemui.dreams.complication.dagger.ComplicationComponent; import com.android.systemui.dreams.touch.scrim.dagger.ScrimModule; +import com.android.systemui.touch.TouchInsetManager; import dagger.Module; import dagger.Provides; import java.util.Optional; +import java.util.concurrent.Executor; import javax.inject.Named; @@ -55,7 +57,7 @@ public interface DreamModule { String DREAM_ONLY_ENABLED_FOR_DOCK_USER = "dream_only_enabled_for_dock_user"; String DREAM_OVERLAY_SERVICE_COMPONENT = "dream_overlay_service_component"; String DREAM_OVERLAY_ENABLED = "dream_overlay_enabled"; - + String DREAM_TOUCH_INSET_MANAGER = "dream_touch_inset_manager"; String DREAM_SUPPORTED = "dream_supported"; String DREAM_OVERLAY_WINDOW_TITLE = "dream_overlay_window_title"; @@ -69,6 +71,15 @@ public interface DreamModule { } /** + * Provides a touch inset manager for dreams. + */ + @Provides + @Named(DREAM_TOUCH_INSET_MANAGER) + static TouchInsetManager providesTouchInsetManager(@Main Executor executor) { + return new TouchInsetManager(executor); + } + + /** * Provides whether dream overlay is enabled. */ @Provides diff --git a/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java b/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java index 757b4e50c3f8..13c1019591a1 100644 --- a/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java +++ b/packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java @@ -25,16 +25,12 @@ import android.view.ViewGroup; import androidx.concurrent.futures.CallbackToFutureAdapter; -import com.android.systemui.dagger.qualifiers.Main; - import com.google.common.util.concurrent.ListenableFuture; import java.util.HashMap; import java.util.HashSet; import java.util.concurrent.Executor; -import javax.inject.Inject; - /** * {@link TouchInsetManager} handles setting the touchable inset regions for a given View. This * is useful for passing through touch events for all but select areas. @@ -153,8 +149,7 @@ public class TouchInsetManager { * Default constructor. * @param executor An {@link Executor} to marshal all operations on. */ - @Inject - public TouchInsetManager(@Main Executor executor) { + public TouchInsetManager(Executor executor) { mExecutor = executor; } |