diff options
| author | 2019-11-15 14:40:00 +0000 | |
|---|---|---|
| committer | 2019-11-15 14:40:00 +0000 | |
| commit | 76939b7e6f5d3c4eb5d04b3bcc7f5eac788cfb3b (patch) | |
| tree | a6a054fa8a0b6508c84b681dd2803f2abc21abee | |
| parent | 018bd0278c1e09210cd628bafd24da5a2d14e8bc (diff) | |
| parent | 95754e7029f6e25cb219eae7036ab59932e3bb79 (diff) | |
Merge changes from topics "b142537875-remove-get-component", "b144284870-get-component-heads-up-manager"
* changes:
Remove SysUiServiceProvider and mComponents.
Remove calls to getComponent(HeadsUpManager.class)
23 files changed, 40 insertions, 120 deletions
diff --git a/packages/CarSystemUI/src/com/android/systemui/CarSystemUIModule.java b/packages/CarSystemUI/src/com/android/systemui/CarSystemUIModule.java index 818fdeaef8db..bffc6b912146 100644 --- a/packages/CarSystemUI/src/com/android/systemui/CarSystemUIModule.java +++ b/packages/CarSystemUI/src/com/android/systemui/CarSystemUIModule.java @@ -26,6 +26,7 @@ import com.android.systemui.car.CarNotificationInterruptionStateProvider; import com.android.systemui.dagger.SystemUIRootComponent; import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManagerImpl; +import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.EnhancedEstimates; import com.android.systemui.power.EnhancedEstimatesImpl; import com.android.systemui.recents.Recents; @@ -38,10 +39,13 @@ import com.android.systemui.statusbar.car.CarStatusBar; import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider; +import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; +import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.volume.CarVolumeDialogComponent; import com.android.systemui.volume.VolumeDialogComponent; @@ -84,6 +88,17 @@ abstract class CarSystemUIModule { @Singleton @Provides + static HeadsUpManagerPhone provideHeadsUpManagerPhone(Context context, + StatusBarStateController statusBarStateController, + KeyguardBypassController bypassController) { + return new HeadsUpManagerPhone(context, statusBarStateController, bypassController); + } + + @Binds + abstract HeadsUpManager bindHeadsUpManagerPhone(HeadsUpManagerPhone headsUpManagerPhone); + + @Singleton + @Provides @Named(LEAK_REPORT_EMAIL_NAME) static String provideLeakReportEmail() { return "buganizer-system+181579@google.com"; diff --git a/packages/SystemUI/README.md b/packages/SystemUI/README.md index a4dbf38d8782..f170a11edd7e 100644 --- a/packages/SystemUI/README.md +++ b/packages/SystemUI/README.md @@ -24,12 +24,6 @@ the main path for onConfigurationChanged, now also happens through ConfigurationController). They also receive a callback for onBootCompleted since these objects may be started before the device has finished booting. -SystemUI and SystemUIApplication also have methods for putComponent and -getComponent which were existing systems to get a hold of other parts of -sysui before Dependency existed. Generally new things should not be added -to putComponent, instead Dependency and other refactoring is preferred to -make sysui structure cleaner. - Each SystemUI service is expected to be a major part of system ui and the goal is to minimize communication between them. So in general they should be relatively silo'd. diff --git a/packages/SystemUI/src/com/android/systemui/SysUiServiceProvider.java b/packages/SystemUI/src/com/android/systemui/SysUiServiceProvider.java deleted file mode 100644 index ff4b7cb0ac71..000000000000 --- a/packages/SystemUI/src/com/android/systemui/SysUiServiceProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package com.android.systemui; - -import android.content.Context; - -/** - * The interface for getting core components of SysUI. Exists for Testability - * since tests don't have SystemUIApplication as their ApplicationContext. - */ -public interface SysUiServiceProvider { - <T> T getComponent(Class<T> interfaceType); - - public static <T> T getComponent(Context context, Class<T> interfaceType) { - return ((SysUiServiceProvider) context.getApplicationContext()).getComponent(interfaceType); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/SystemUI.java b/packages/SystemUI/src/com/android/systemui/SystemUI.java index 75700379caca..f795faf30603 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUI.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUI.java @@ -23,11 +23,9 @@ import android.os.Bundle; import java.io.FileDescriptor; import java.io.PrintWriter; -import java.util.Map; -public abstract class SystemUI implements SysUiServiceProvider { +public abstract class SystemUI { protected final Context mContext; - public Map<Class<?>, Object> mComponents; public SystemUI(Context context) { mContext = context; @@ -44,17 +42,6 @@ public abstract class SystemUI implements SysUiServiceProvider { protected void onBootCompleted() { } - @SuppressWarnings("unchecked") - public <T> T getComponent(Class<T> interfaceType) { - return (T) (mComponents != null ? mComponents.get(interfaceType) : null); - } - - public <T, C extends T> void putComponent(Class<T> interfaceType, C component) { - if (mComponents != null) { - mComponents.put(interfaceType, component); - } - } - public static void overrideNotificationAppName(Context context, Notification.Builder n, boolean system) { final Bundle extras = new Bundle(); diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 4b28e4af7d8b..f0317b4a02d0 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -36,13 +36,11 @@ import com.android.systemui.util.NotificationChannels; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; /** * Application class for SystemUI. */ -public class SystemUIApplication extends Application implements SysUiServiceProvider, +public class SystemUIApplication extends Application implements SystemUIAppComponentFactory.ContextInitializer { public static final String TAG = "SystemUIService"; @@ -56,7 +54,6 @@ public class SystemUIApplication extends Application implements SysUiServiceProv private SystemUI[] mServices; private boolean mServicesStarted; private boolean mBootCompleted; - private final Map<Class<?>, Object> mComponents = new HashMap<>(); private SystemUIAppComponentFactory.ContextAvailableCallback mContextAvailableCallback; public SystemUIApplication() { @@ -199,7 +196,6 @@ public class SystemUIApplication extends Application implements SysUiServiceProv throw new RuntimeException(ex); } - mServices[i].mComponents = mComponents; if (DEBUG) Log.d(TAG, "running: " + mServices[i]); mServices[i].start(); log.traceEnd(); @@ -232,11 +228,6 @@ public class SystemUIApplication extends Application implements SysUiServiceProv } } - @SuppressWarnings("unchecked") - public <T> T getComponent(Class<T> interfaceType) { - return (T) mComponents.get(interfaceType); - } - public SystemUI[] getServices() { return mServices; } diff --git a/packages/SystemUI/src/com/android/systemui/dagger/DependencyBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/DependencyBinder.java index 7007f9defee6..6744d74004f0 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/DependencyBinder.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/DependencyBinder.java @@ -35,7 +35,6 @@ import com.android.systemui.statusbar.StatusBarStateControllerImpl; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DarkIconDispatcherImpl; import com.android.systemui.statusbar.phone.DozeServiceHost; -import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; import com.android.systemui.statusbar.phone.ManagedProfileController; import com.android.systemui.statusbar.phone.ManagedProfileControllerImpl; import com.android.systemui.statusbar.phone.StatusBarIconController; @@ -51,7 +50,6 @@ import com.android.systemui.statusbar.policy.ExtensionController; import com.android.systemui.statusbar.policy.ExtensionControllerImpl; import com.android.systemui.statusbar.policy.FlashlightController; import com.android.systemui.statusbar.policy.FlashlightControllerImpl; -import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.HotspotController; import com.android.systemui.statusbar.policy.HotspotControllerImpl; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -259,7 +257,4 @@ public abstract class DependencyBinder { @Binds public abstract VolumeComponent provideVolumeComponent( VolumeDialogComponent volumeDialogComponent); - /** */ - @Binds - public abstract HeadsUpManager bindHeadsUpManager(HeadsUpManagerPhone headsUpManagerPhone); } diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java index f1d02bb61ef9..f44eae76ec50 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java @@ -25,6 +25,7 @@ import androidx.annotation.Nullable; import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManagerImpl; +import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.EnhancedEstimates; import com.android.systemui.power.EnhancedEstimatesImpl; import com.android.systemui.recents.Recents; @@ -34,9 +35,12 @@ import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl; import com.android.systemui.statusbar.notification.NotificationEntryManager; +import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; +import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.Optional; @@ -93,6 +97,17 @@ abstract class SystemUIDefaultModule { return new Divider(context, recentsOptionalLazy); } + @Singleton + @Provides + static HeadsUpManagerPhone provideHeadsUpManagerPhone(Context context, + StatusBarStateController statusBarStateController, + KeyguardBypassController bypassController) { + return new HeadsUpManagerPhone(context, statusBarStateController, bypassController); + } + + @Binds + abstract HeadsUpManager bindHeadsUpManagerPhone(HeadsUpManagerPhone headsUpManagerPhone); + @Provides @Singleton static Recents provideRecents(Context context, RecentsImplementation recentsImplementation, diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index 41ef8fcfdc53..0ac158d1b38a 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -33,6 +33,7 @@ import com.android.systemui.statusbar.notification.collection.listbuilder.NotifL import com.android.systemui.statusbar.notification.people.PeopleHubModule; import com.android.systemui.statusbar.phone.KeyguardLiftController; import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.util.sensors.AsyncSensorManager; import com.android.systemui.util.time.SystemClock; import com.android.systemui.util.time.SystemClockImpl; @@ -84,6 +85,9 @@ public abstract class SystemUIModule { abstract Divider optionalDivider(); @BindsOptionalOf + abstract HeadsUpManager optionalHeadsUpManager(); + + @BindsOptionalOf abstract Recents optionalRecents(); @BindsOptionalOf diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java index 60bc6b6855e6..fcdd23463c5b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java @@ -35,7 +35,6 @@ import android.widget.Toast; import com.android.systemui.Dependency; import com.android.systemui.R; -import com.android.systemui.SysUiServiceProvider; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.stackdivider.Divider; @@ -73,7 +72,7 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation { } @Override - public void onStart(Context context, SysUiServiceProvider sysUiServiceProvider) { + public void onStart(Context context) { mContext = context; mHandler = new Handler(); mTrustManager = (TrustManager) context.getSystemService(Context.TRUST_SERVICE); diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index 882930bc1049..5f37cc4520a3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java @@ -45,7 +45,7 @@ public class Recents extends SystemUI implements CommandQueue.Callbacks { @Override public void start() { mCommandQueue.addCallback(this); - mImpl.onStart(mContext, this); + mImpl.onStart(mContext); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImplementation.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImplementation.java index 8cd17e9a1728..1d29ac629cd8 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImplementation.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImplementation.java @@ -19,15 +19,13 @@ import android.content.Context; import android.content.res.Configuration; import android.graphics.Rect; -import com.android.systemui.SysUiServiceProvider; - import java.io.PrintWriter; /** * API for creating a Recents view. */ public interface RecentsImplementation { - default void onStart(Context context, SysUiServiceProvider sysUiServiceProvider) {} + default void onStart(Context context) {} default void onBootCompleted() {} default void onAppTransitionFinished() {} default void onConfigurationChanged(Configuration newConfig) {} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java index 4e06c84c30be..6ac6d354cfff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java @@ -52,13 +52,9 @@ import java.io.PrintWriter; import java.util.HashSet; import java.util.Stack; -import javax.inject.Inject; -import javax.inject.Singleton; - /** * A implementation of HeadsUpManager for phone and car. */ -@Singleton public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, VisualStabilityManager.Callback, OnHeadsUpChangedListener, ConfigurationController.ConfigurationListener, StateListener { @@ -113,7 +109,6 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, /////////////////////////////////////////////////////////////////////////////////////////////// // Constructor: - @Inject public HeadsUpManagerPhone(@NonNull final Context context, StatusBarStateController statusBarStateController, KeyguardBypassController bypassController) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 6e0a46117861..fafdf6aa1128 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -148,7 +148,6 @@ import com.android.systemui.bubbles.BubbleController; import com.android.systemui.charging.WirelessChargingAnimation; import com.android.systemui.classifier.FalsingLog; import com.android.systemui.colorextraction.SysuiColorExtractor; -import com.android.systemui.doze.DozeHost; import com.android.systemui.fragments.ExtensionFragmentListener; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.keyguard.DismissCallbackRegistry; @@ -222,7 +221,6 @@ import com.android.systemui.statusbar.policy.ConfigurationController.Configurati import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.ExtensionController; -import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcher; import com.android.systemui.statusbar.policy.NetworkController; @@ -795,7 +793,6 @@ public class StatusBar extends SystemUI implements DemoMode, R.bool.config_vibrateOnIconAnimation); DateTimeView.setReceiverHandler(Dependency.get(Dependency.TIME_TICK_HANDLER)); - putComponent(StatusBar.class, this); // start old BaseStatusBar.start(). mWindowManagerService = WindowManagerGlobal.getWindowManagerService(); @@ -897,7 +894,6 @@ public class StatusBar extends SystemUI implements DemoMode, mDozeServiceHost.initialize(this, mNotificationIconAreaController, mStatusBarWindowViewController, mStatusBarWindow, mStatusBarKeyguardViewManager, mNotificationPanel, mAmbientIndicationContainer); - putComponent(DozeHost.class, mDozeServiceHost); Dependency.get(ActivityStarterDelegate.class).setActivityStarterImpl(this); @@ -1053,7 +1049,6 @@ public class StatusBar extends SystemUI implements DemoMode, mGroupManager.setHeadsUpManager(mHeadsUpManager); mGroupAlertTransferHelper.setHeadsUpManager(mHeadsUpManager); mNotificationLogger.setHeadsUpManager(mHeadsUpManager); - putComponent(HeadsUpManager.class, mHeadsUpManager); createNavigationBar(result); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java index 379cf1f273e5..39de0f3f5a9f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java @@ -50,8 +50,6 @@ public class TvStatusBar extends SystemUI implements CommandQueue.Callbacks { @Override public void start() { - putComponent(TvStatusBar.class, this); - final IStatusBarService barService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mCommandQueue.addCallback(this); diff --git a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java index 1e9000b76c3f..ba264c0ae6db 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java @@ -136,7 +136,6 @@ public class ScreenDecorationsTest extends SysuiTestCase { mTestableLooper.processAllMessages(); } }; - mScreenDecorations.mComponents = mContext.getComponents(); reset(mTunerService); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestableContext.java b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestableContext.java index f792d7d11e15..d847208bc4f7 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/SysuiTestableContext.java +++ b/packages/SystemUI/tests/src/com/android/systemui/SysuiTestableContext.java @@ -17,13 +17,9 @@ package com.android.systemui; import android.content.Context; import android.testing.LeakCheck; import android.testing.TestableContext; -import android.util.ArrayMap; import android.view.Display; -public class SysuiTestableContext extends TestableContext implements SysUiServiceProvider { - - private ArrayMap<Class<?>, Object> mComponents; - +public class SysuiTestableContext extends TestableContext { public SysuiTestableContext(Context base) { super(base); setTheme(R.style.Theme_SystemUI); @@ -34,21 +30,6 @@ public class SysuiTestableContext extends TestableContext implements SysUiServic setTheme(R.style.Theme_SystemUI); } - public ArrayMap<Class<?>, Object> getComponents() { - if (mComponents == null) mComponents = new ArrayMap<>(); - return mComponents; - } - - @SuppressWarnings("unchecked") - public <T> T getComponent(Class<T> interfaceType) { - return (T) (mComponents != null ? mComponents.get(interfaceType) : null); - } - - public <T, C extends T> void putComponent(Class<T> interfaceType, C component) { - if (mComponents == null) mComponents = new ArrayMap<>(); - mComponents.put(interfaceType, component); - } - @Override public Context createDisplayContext(Display display) { if (display == null) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java index 486fa12e0577..f6375fce8b4e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java @@ -53,7 +53,6 @@ import android.testing.TestableLooper.RunWithLooper; import com.android.internal.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.CommandQueue; -import com.android.systemui.statusbar.phone.StatusBar; import org.junit.Before; import org.junit.Test; @@ -88,8 +87,6 @@ public class AuthControllerTest extends SysuiTestCase { TestableContext context = spy(mContext); - mContext.putComponent(StatusBar.class, mock(StatusBar.class)); - when(context.getPackageManager()).thenReturn(mPackageManager); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)) .thenReturn(true); @@ -104,7 +101,6 @@ public class AuthControllerTest extends SysuiTestCase { mAuthController = new TestableAuthController( context, mock(CommandQueue.class), new MockInjector()); - mAuthController.mComponents = mContext.getComponents(); mAuthController.start(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java index 47b35fdc6dc1..e8f19238fdb8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java @@ -687,7 +687,6 @@ public class PowerUITest extends SysuiTestCase { private void createPowerUi() { mPowerUI = new PowerUI(mContext, mBroadcastDispatcher, mStatusBarLazy); - mPowerUI.mComponents = mContext.getComponents(); mPowerUI.mThermalService = mThermalServiceMock; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java index bc4e401c49e4..8decae33d45b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragmentTest.java @@ -34,8 +34,6 @@ import androidx.test.filters.SmallTest; import com.android.systemui.R; import com.android.systemui.SysuiBaseFragmentTest; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.CommandQueue; -import com.android.systemui.tuner.TunerService; import org.junit.Before; import org.junit.Test; @@ -58,10 +56,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest { @Before public void setup() { - mSysuiContext.putComponent(CommandQueue.class, mock(CommandQueue.class)); StatusBar statusBar = mock(StatusBar.class); mDependency.injectTestDependency(StatusBar.class, statusBar); - mSysuiContext.putComponent(TunerService.class, mock(TunerService.class)); mStatusBarStateController = mDependency .injectMockDependency(StatusBarStateController.class); injectLeakCheckedDependencies(ALL_SUPPORTED_CLASSES); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarButtonTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarButtonTest.java index 098a69f5a897..aae075777506 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarButtonTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarButtonTest.java @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.phone; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; import android.graphics.PixelFormat; import android.hardware.display.DisplayManager; @@ -37,7 +36,6 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.SysuiTestableContext; import com.android.systemui.assist.AssistManager; import com.android.systemui.recents.OverviewProxyService; -import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.policy.KeyguardStateController; import org.junit.After; @@ -60,11 +58,9 @@ public class NavigationBarButtonTest extends SysuiTestCase { @Before public void setup() { - mContext.putComponent(CommandQueue.class, mock(CommandQueue.class)); final Display display = createVirtualDisplay(); final SysuiTestableContext context = (SysuiTestableContext) mContext.createDisplayContext(display); - context.putComponent(CommandQueue.class, mock(CommandQueue.class)); mDependency.injectMockDependency(AssistManager.class); mDependency.injectMockDependency(OverviewProxyService.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarInflaterViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarInflaterViewTest.java index 991e49588417..80e33fbc6acb 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarInflaterViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarInflaterViewTest.java @@ -33,7 +33,6 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.assist.AssistManager; import com.android.systemui.recents.OverviewProxyService; -import com.android.systemui.statusbar.CommandQueue; import org.junit.After; import org.junit.Before; @@ -52,7 +51,6 @@ public class NavigationBarInflaterViewTest extends SysuiTestCase { @Before public void setUp() { - mContext.putComponent(CommandQueue.class, mock(CommandQueue.class)); mDependency.injectMockDependency(AssistManager.class); mDependency.injectMockDependency(OverviewProxyService.class); mDependency.injectMockDependency(NavigationModeController.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index aecdd83e24b7..1f2df653490c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -389,7 +389,6 @@ public class StatusBarTest extends SysuiTestCase { // TODO: we should be able to call mStatusBar.start() and have all the below values // initialized automatically. - mStatusBar.mComponents = mContext.getComponents(); mStatusBar.mStatusBarWindow = mStatusBarWindowView; mStatusBar.mNotificationPanel = mNotificationPanelView; mStatusBar.mDozeScrimController = mDozeScrimController; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java index 4d4e9ae47d18..e08551abdca2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowViewTest.java @@ -82,7 +82,6 @@ public class StatusBarWindowViewTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); mView = new StatusBarWindowView(getContext(), null); - mContext.putComponent(StatusBar.class, mStatusBar); when(mStatusBar.isDozing()).thenReturn(false); mDependency.injectTestDependency(ShadeController.class, mShadeController); |