From e2b4d79fe5deebe17176919364567897d7d67157 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Fri, 9 Mar 2018 13:42:18 -0800 Subject: [PATCH] Moved VibrateHelper as a dependency VibrateHelper is a dependency to minimize number of event listeners. This is related to the change ag/3711731. Bug: 73942704 Test: manual, press home button when quick step is enabled Change-Id: Ic982cd16d88224003aa53847daaa04372898ef22 --- packages/SystemUI/src/com/android/systemui/Dependency.java | 3 +++ .../src/com/android/systemui/statusbar/phone/NavigationBarView.java | 2 +- .../SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java | 3 ++- .../src/com/android/systemui/statusbar/policy/KeyButtonView.java | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java index cad155c43867..5fce0a6d641c 100644 --- a/packages/SystemUI/src/com/android/systemui/Dependency.java +++ b/packages/SystemUI/src/com/android/systemui/Dependency.java @@ -45,6 +45,7 @@ import com.android.systemui.power.EnhancedEstimatesImpl; import com.android.systemui.power.PowerNotificationWarnings; import com.android.systemui.power.PowerUI; import com.android.systemui.statusbar.AppOpsListener; +import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.ConfigurationControllerImpl; import com.android.systemui.statusbar.phone.DarkIconDispatcherImpl; import com.android.systemui.statusbar.phone.LightBarController; @@ -317,6 +318,8 @@ public class Dependency extends SystemUI { mProviders.put(AppOpsListener.class, () -> new AppOpsListener(mContext)); + mProviders.put(VibratorHelper.class, () -> new VibratorHelper(mContext)); + // Put all dependencies above here so the factory can override them if it wants. SystemUIFactory.getInstance().injectDependencies(mProviders, mContext); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index ca5a3503b548..1f0601628f9d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -246,7 +246,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener