diff options
59 files changed, 168 insertions, 197 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardBiometricLockoutLogger.kt b/packages/SystemUI/src/com/android/keyguard/KeyguardBiometricLockoutLogger.kt index 692fe83ee2b8..e6a2bfa1af12 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardBiometricLockoutLogger.kt +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardBiometricLockoutLogger.kt @@ -17,7 +17,6 @@ package com.android.keyguard import android.app.StatusBarManager.SESSION_KEYGUARD -import android.content.Context import android.hardware.biometrics.BiometricSourceType import com.android.internal.annotations.VisibleForTesting import com.android.internal.logging.UiEvent @@ -41,11 +40,10 @@ import javax.inject.Inject */ @SysUISingleton class KeyguardBiometricLockoutLogger @Inject constructor( - context: Context?, private val uiEventLogger: UiEventLogger, private val keyguardUpdateMonitor: KeyguardUpdateMonitor, private val sessionTracker: SessionTracker -) : CoreStartable(context) { +) : CoreStartable { private var fingerprintLockedOut = false private var faceLockedOut = false private var encryptedOrLockdown = false @@ -169,4 +167,4 @@ class KeyguardBiometricLockoutLogger @Inject constructor( return strongAuthFlags and flagCheck != 0 } } -}
\ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/systemui/ChooserSelector.kt b/packages/SystemUI/src/com/android/systemui/ChooserSelector.kt index 37829f25d179..a89cbf57f95b 100644 --- a/packages/SystemUI/src/com/android/systemui/ChooserSelector.kt +++ b/packages/SystemUI/src/com/android/systemui/ChooserSelector.kt @@ -19,11 +19,11 @@ import kotlinx.coroutines.withContext @SysUISingleton class ChooserSelector @Inject constructor( - context: Context, + private val context: Context, private val featureFlags: FeatureFlags, @Application private val coroutineScope: CoroutineScope, @Background private val bgDispatcher: CoroutineDispatcher -) : CoreStartable(context) { +) : CoreStartable { private val packageManager = context.packageManager private val chooserComponent = ComponentName.unflattenFromString( diff --git a/packages/SystemUI/src/com/android/systemui/CoreStartable.java b/packages/SystemUI/src/com/android/systemui/CoreStartable.java index 0201cdc25319..929ebea37eef 100644 --- a/packages/SystemUI/src/com/android/systemui/CoreStartable.java +++ b/packages/SystemUI/src/com/android/systemui/CoreStartable.java @@ -16,39 +16,41 @@ package com.android.systemui; -import android.content.Context; import android.content.res.Configuration; import androidx.annotation.NonNull; -import com.android.internal.annotations.VisibleForTesting; - import java.io.PrintWriter; /** - * A top-level module of system UI code (sometimes called "system UI services" elsewhere in code). - * Which CoreStartable modules are loaded can be controlled via a config resource. + * Code that needs to be run when SystemUI is started. + * + * Which CoreStartable modules are loaded is controlled via the dagger graph. Bind them into the + * CoreStartable map with code such as: + * + * <pre> + * @Binds + * @IntoMap + * @ClassKey(FoobarStartable::class) + * abstract fun bind(impl: FoobarStartable): CoreStartable + * </pre> * * @see SystemUIApplication#startServicesIfNeeded() */ -public abstract class CoreStartable implements Dumpable { - protected final Context mContext; - - public CoreStartable(Context context) { - mContext = context; - } +public interface CoreStartable extends Dumpable { /** Main entry point for implementations. Called shortly after app startup. */ - public abstract void start(); + void start(); - protected void onConfigurationChanged(Configuration newConfig) { + /** */ + default void onConfigurationChanged(Configuration newConfig) { } @Override - public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { + default void dump(@NonNull PrintWriter pw, @NonNull String[] args) { } - @VisibleForTesting - protected void onBootCompleted() { + /** Called when the device reports BOOT_COMPLETED. */ + default void onBootCompleted() { } } diff --git a/packages/SystemUI/src/com/android/systemui/LatencyTester.java b/packages/SystemUI/src/com/android/systemui/LatencyTester.java index 9cdce6400e56..8f419560c78d 100644 --- a/packages/SystemUI/src/com/android/systemui/LatencyTester.java +++ b/packages/SystemUI/src/com/android/systemui/LatencyTester.java @@ -46,7 +46,7 @@ import javax.inject.Inject; * system that are used for testing the latency. */ @SysUISingleton -public class LatencyTester extends CoreStartable { +public class LatencyTester implements CoreStartable { private static final boolean DEFAULT_ENABLED = Build.IS_ENG; private static final String ACTION_FINGERPRINT_WAKE = @@ -62,13 +62,11 @@ public class LatencyTester extends CoreStartable { @Inject public LatencyTester( - Context context, BiometricUnlockController biometricUnlockController, BroadcastDispatcher broadcastDispatcher, DeviceConfigProxy deviceConfigProxy, @Main DelayableExecutor mainExecutor ) { - super(context); mBiometricUnlockController = biometricUnlockController; mBroadcastDispatcher = broadcastDispatcher; mDeviceConfigProxy = deviceConfigProxy; diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 2e13903814a5..b5f42a164495 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -105,7 +105,7 @@ import kotlin.Pair; * for antialiasing and emulation purposes. */ @SysUISingleton -public class ScreenDecorations extends CoreStartable implements Tunable , Dumpable { +public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { private static final boolean DEBUG = false; private static final String TAG = "ScreenDecorations"; @@ -130,6 +130,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @VisibleForTesting protected boolean mIsRegistered; private final BroadcastDispatcher mBroadcastDispatcher; + private final Context mContext; private final Executor mMainExecutor; private final TunerService mTunerService; private final SecureSettings mSecureSettings; @@ -308,7 +309,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab ThreadFactory threadFactory, PrivacyDotDecorProviderFactory dotFactory, FaceScanningProviderFactory faceScanningFactory) { - super(context); + mContext = context; mMainExecutor = mainExecutor; mSecureSettings = secureSettings; mBroadcastDispatcher = broadcastDispatcher; @@ -973,7 +974,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab } @Override - protected void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(Configuration newConfig) { if (DEBUG_DISABLE_SCREEN_DECORATIONS) { Log.i(TAG, "ScreenDecorations is disabled"); return; diff --git a/packages/SystemUI/src/com/android/systemui/SliceBroadcastRelayHandler.java b/packages/SystemUI/src/com/android/systemui/SliceBroadcastRelayHandler.java index 1f2de4cfc346..5bd85a72b06f 100644 --- a/packages/SystemUI/src/com/android/systemui/SliceBroadcastRelayHandler.java +++ b/packages/SystemUI/src/com/android/systemui/SliceBroadcastRelayHandler.java @@ -38,16 +38,17 @@ import javax.inject.Inject; * @see SliceBroadcastRelay */ @SysUISingleton -public class SliceBroadcastRelayHandler extends CoreStartable { +public class SliceBroadcastRelayHandler implements CoreStartable { private static final String TAG = "SliceBroadcastRelay"; private static final boolean DEBUG = false; private final ArrayMap<Uri, BroadcastRelay> mRelays = new ArrayMap<>(); + private final Context mContext; private final BroadcastDispatcher mBroadcastDispatcher; @Inject public SliceBroadcastRelayHandler(Context context, BroadcastDispatcher broadcastDispatcher) { - super(context); + mContext = context; mBroadcastDispatcher = broadcastDispatcher; } diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 9138b2346ab8..8415ef88f6a0 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -47,8 +47,6 @@ import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dump.DumpManager; import com.android.systemui.util.NotificationChannels; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.util.Comparator; import java.util.Map; import java.util.TreeMap; @@ -296,14 +294,10 @@ public class SystemUIApplication extends Application implements CoreStartable startable; if (DEBUG) Log.d(TAG, "loading: " + clsName); try { - Constructor<?> constructor = Class.forName(clsName).getConstructor( - Context.class); - startable = (CoreStartable) constructor.newInstance(this); + startable = (CoreStartable) Class.forName(clsName).newInstance(); } catch (ClassNotFoundException - | NoSuchMethodException | IllegalAccessException - | InstantiationException - | InvocationTargetException ex) { + | InstantiationException ex) { throw new RuntimeException(ex); } diff --git a/packages/SystemUI/src/com/android/systemui/VendorServices.java b/packages/SystemUI/src/com/android/systemui/VendorServices.java index 139448c0fab4..a3209396ac27 100644 --- a/packages/SystemUI/src/com/android/systemui/VendorServices.java +++ b/packages/SystemUI/src/com/android/systemui/VendorServices.java @@ -16,15 +16,12 @@ package com.android.systemui; -import android.content.Context; - /** * Placeholder for any vendor-specific services. */ -public class VendorServices extends CoreStartable { +public class VendorServices implements CoreStartable { - public VendorServices(Context context) { - super(context); + public VendorServices() { } @Override diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java index a1288b531955..9f1c9b45e6cd 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java @@ -69,7 +69,7 @@ import dagger.Lazy; * Class to register system actions with accessibility framework. */ @SysUISingleton -public class SystemActions extends CoreStartable { +public class SystemActions implements CoreStartable { private static final String TAG = "SystemActions"; /** @@ -177,6 +177,7 @@ public class SystemActions extends CoreStartable { private static final String PERMISSION_SELF = "com.android.systemui.permission.SELF"; private final SystemActionsBroadcastReceiver mReceiver; + private final Context mContext; private final Optional<Recents> mRecentsOptional; private Locale mLocale; private final AccessibilityManager mA11yManager; @@ -190,7 +191,7 @@ public class SystemActions extends CoreStartable { NotificationShadeWindowController notificationShadeController, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, Optional<Recents> recentsOptional) { - super(context); + mContext = context; mRecentsOptional = recentsOptional; mReceiver = new SystemActionsBroadcastReceiver(); mLocale = mContext.getResources().getConfiguration().getLocales().get(0); @@ -219,7 +220,6 @@ public class SystemActions extends CoreStartable { @Override public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); final Locale locale = mContext.getResources().getConfiguration().getLocales().get(0); if (!locale.equals(mLocale)) { mLocale = locale; diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnification.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnification.java index 6e14ddc671a3..ab11fcea7b28 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnification.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnification.java @@ -52,11 +52,12 @@ import javax.inject.Inject; * when {@code IStatusBar#requestWindowMagnificationConnection(boolean)} is called. */ @SysUISingleton -public class WindowMagnification extends CoreStartable implements WindowMagnifierCallback, +public class WindowMagnification implements CoreStartable, WindowMagnifierCallback, CommandQueue.Callbacks { private static final String TAG = "WindowMagnification"; private final ModeSwitchesController mModeSwitchesController; + private final Context mContext; private final Handler mHandler; private final AccessibilityManager mAccessibilityManager; private final CommandQueue mCommandQueue; @@ -102,7 +103,7 @@ public class WindowMagnification extends CoreStartable implements WindowMagnifie public WindowMagnification(Context context, @Main Handler mainHandler, CommandQueue commandQueue, ModeSwitchesController modeSwitchesController, SysUiState sysUiState, OverviewProxyService overviewProxyService) { - super(context); + mContext = context; mHandler = mainHandler; mAccessibilityManager = mContext.getSystemService(AccessibilityManager.class); mCommandQueue = commandQueue; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java index aae92adc5880..d43e5d9d09cc 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java @@ -102,7 +102,7 @@ import kotlin.Unit; * {@link com.android.keyguard.KeyguardUpdateMonitor} */ @SysUISingleton -public class AuthController extends CoreStartable implements CommandQueue.Callbacks, +public class AuthController implements CoreStartable, CommandQueue.Callbacks, AuthDialogCallback, DozeReceiver { private static final String TAG = "AuthController"; @@ -110,6 +110,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba private static final int SENSOR_PRIVACY_DELAY = 500; private final Handler mHandler; + private final Context mContext; private final Execution mExecution; private final CommandQueue mCommandQueue; private final StatusBarStateController mStatusBarStateController; @@ -669,7 +670,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba @NonNull InteractionJankMonitor jankMonitor, @Main Handler handler, @Background DelayableExecutor bgExecutor) { - super(context); + mContext = context; mExecution = execution; mUserManager = userManager; mLockPatternUtils = lockPatternUtils; @@ -1099,8 +1100,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba } @Override - protected void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); + public void onConfigurationChanged(Configuration newConfig) { updateSensorLocations(); // Save the state of the current dialog (buttons showing, etc) diff --git a/packages/SystemUI/src/com/android/systemui/broadcast/BroadcastDispatcherStartable.kt b/packages/SystemUI/src/com/android/systemui/broadcast/BroadcastDispatcherStartable.kt index d7b263a323ca..c536e81ef20a 100644 --- a/packages/SystemUI/src/com/android/systemui/broadcast/BroadcastDispatcherStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/broadcast/BroadcastDispatcherStartable.kt @@ -16,16 +16,14 @@ package com.android.systemui.broadcast -import android.content.Context import com.android.systemui.CoreStartable import javax.inject.Inject class BroadcastDispatcherStartable @Inject constructor( - context: Context, val broadcastDispatcher: BroadcastDispatcher -) : CoreStartable(context) { +) : CoreStartable { override fun start() { broadcastDispatcher.initialize() } -}
\ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java index f526277a0a37..05e3f1ce87a6 100644 --- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java +++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java @@ -39,8 +39,8 @@ import javax.inject.Inject; * ClipboardListener brings up a clipboard overlay when something is copied to the clipboard. */ @SysUISingleton -public class ClipboardListener extends CoreStartable - implements ClipboardManager.OnPrimaryClipChangedListener { +public class ClipboardListener implements + CoreStartable, ClipboardManager.OnPrimaryClipChangedListener { private static final String TAG = "ClipboardListener"; @VisibleForTesting @@ -49,6 +49,7 @@ public class ClipboardListener extends CoreStartable static final String EXTRA_SUPPRESS_OVERLAY = "com.android.systemui.SUPPRESS_CLIPBOARD_OVERLAY"; + private final Context mContext; private final DeviceConfigProxy mDeviceConfig; private final ClipboardOverlayControllerFactory mOverlayFactory; private final ClipboardManager mClipboardManager; @@ -59,7 +60,7 @@ public class ClipboardListener extends CoreStartable public ClipboardListener(Context context, DeviceConfigProxy deviceConfigProxy, ClipboardOverlayControllerFactory overlayFactory, ClipboardManager clipboardManager, UiEventLogger uiEventLogger) { - super(context); + mContext = context; mDeviceConfig = deviceConfigProxy; mOverlayFactory = overlayFactory; mClipboardManager = clipboardManager; diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.java index 99ca3c76cf8d..d145f5c14917 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.java @@ -40,11 +40,12 @@ import javax.inject.Inject; * {@link DreamOverlayRegistrant} is responsible for telling system server that SystemUI should be * the designated dream overlay component. */ -public class DreamOverlayRegistrant extends CoreStartable { +public class DreamOverlayRegistrant implements CoreStartable { private static final String TAG = "DreamOverlayRegistrant"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private final IDreamManager mDreamManager; private final ComponentName mOverlayServiceComponent; + private final Context mContext; private final Resources mResources; private boolean mCurrentRegisteredState = false; @@ -98,7 +99,7 @@ public class DreamOverlayRegistrant extends CoreStartable { @Inject public DreamOverlayRegistrant(Context context, @Main Resources resources) { - super(context); + mContext = context; mResources = resources; mDreamManager = IDreamManager.Stub.asInterface( ServiceManager.getService(DreamService.DREAM_SERVICE)); diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationTypesUpdater.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationTypesUpdater.java index bbcab60d7ba2..ee2f1af6a99b 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationTypesUpdater.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationTypesUpdater.java @@ -16,7 +16,6 @@ package com.android.systemui.dreams.complication; -import android.content.Context; import android.database.ContentObserver; import android.os.UserHandle; import android.provider.Settings; @@ -37,7 +36,7 @@ import javax.inject.Inject; * user, and pushes updates to {@link DreamOverlayStateController}. */ @SysUISingleton -public class ComplicationTypesUpdater extends CoreStartable { +public class ComplicationTypesUpdater implements CoreStartable { private final DreamBackend mDreamBackend; private final Executor mExecutor; private final SecureSettings mSecureSettings; @@ -45,13 +44,11 @@ public class ComplicationTypesUpdater extends CoreStartable { private final DreamOverlayStateController mDreamOverlayStateController; @Inject - ComplicationTypesUpdater(Context context, + ComplicationTypesUpdater( DreamBackend dreamBackend, @Main Executor executor, SecureSettings secureSettings, DreamOverlayStateController dreamOverlayStateController) { - super(context); - mDreamBackend = dreamBackend; mExecutor = executor; mSecureSettings = secureSettings; diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamClockTimeComplication.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamClockTimeComplication.java index 675a2f46d310..77e1fc91e6ee 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamClockTimeComplication.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamClockTimeComplication.java @@ -19,7 +19,6 @@ package com.android.systemui.dreams.complication; import static com.android.systemui.dreams.complication.dagger.DreamClockTimeComplicationModule.DREAM_CLOCK_TIME_COMPLICATION_VIEW; import static com.android.systemui.dreams.complication.dagger.RegisteredComplicationsModule.DREAM_CLOCK_TIME_COMPLICATION_LAYOUT_PARAMS; -import android.content.Context; import android.view.View; import com.android.systemui.CoreStartable; @@ -61,7 +60,7 @@ public class DreamClockTimeComplication implements Complication { * {@link CoreStartable} responsible for registering {@link DreamClockTimeComplication} with * SystemUI. */ - public static class Registrant extends CoreStartable { + public static class Registrant implements CoreStartable { private final DreamOverlayStateController mDreamOverlayStateController; private final DreamClockTimeComplication mComplication; @@ -69,10 +68,9 @@ public class DreamClockTimeComplication implements Complication { * Default constructor to register {@link DreamClockTimeComplication}. */ @Inject - public Registrant(Context context, + public Registrant( DreamOverlayStateController dreamOverlayStateController, DreamClockTimeComplication dreamClockTimeComplication) { - super(context); mDreamOverlayStateController = dreamOverlayStateController; mComplication = dreamClockTimeComplication; } diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamHomeControlsComplication.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamHomeControlsComplication.java index 821e13ef733c..0ccb222c8acc 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamHomeControlsComplication.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/DreamHomeControlsComplication.java @@ -71,7 +71,7 @@ public class DreamHomeControlsComplication implements Complication { /** * {@link CoreStartable} for registering the complication with SystemUI on startup. */ - public static class Registrant extends CoreStartable { + public static class Registrant implements CoreStartable { private final DreamHomeControlsComplication mComplication; private final DreamOverlayStateController mDreamOverlayStateController; private final ControlsComponent mControlsComponent; @@ -90,11 +90,9 @@ public class DreamHomeControlsComplication implements Complication { }; @Inject - public Registrant(Context context, DreamHomeControlsComplication complication, + public Registrant(DreamHomeControlsComplication complication, DreamOverlayStateController dreamOverlayStateController, ControlsComponent controlsComponent) { - super(context); - mComplication = complication; mControlsComponent = controlsComponent; mDreamOverlayStateController = dreamOverlayStateController; diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/SmartSpaceComplication.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/SmartSpaceComplication.java index a981f255a873..c3aaf0cbf2d7 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/SmartSpaceComplication.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/SmartSpaceComplication.java @@ -61,7 +61,7 @@ public class SmartSpaceComplication implements Complication { * {@link CoreStartable} responsbile for registering {@link SmartSpaceComplication} with * SystemUI. */ - public static class Registrant extends CoreStartable { + public static class Registrant implements CoreStartable { private final DreamSmartspaceController mSmartSpaceController; private final DreamOverlayStateController mDreamOverlayStateController; private final SmartSpaceComplication mComplication; @@ -78,11 +78,10 @@ public class SmartSpaceComplication implements Complication { * Default constructor for {@link SmartSpaceComplication}. */ @Inject - public Registrant(Context context, + public Registrant( DreamOverlayStateController dreamOverlayStateController, SmartSpaceComplication smartSpaceComplication, DreamSmartspaceController smartSpaceController) { - super(context); mDreamOverlayStateController = dreamOverlayStateController; mComplication = smartSpaceComplication; mSmartSpaceController = smartSpaceController; diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt index c0e30211e018..560dcbd78c42 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt @@ -16,9 +16,7 @@ package com.android.systemui.flags -import android.content.Context import com.android.systemui.CoreStartable -import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager import com.android.systemui.statusbar.commandline.CommandRegistry import dagger.Binds @@ -30,12 +28,11 @@ import javax.inject.Inject class FeatureFlagsDebugStartable @Inject constructor( - @Application context: Context, dumpManager: DumpManager, private val commandRegistry: CommandRegistry, private val flagCommand: FlagCommand, featureFlags: FeatureFlags -) : CoreStartable(context) { +) : CoreStartable { init { dumpManager.registerDumpable(FeatureFlagsDebug.TAG) { pw, args -> diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt index f138f1e8aa79..e7d8cc362c56 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt @@ -16,9 +16,7 @@ package com.android.systemui.flags -import android.content.Context import com.android.systemui.CoreStartable -import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager import dagger.Binds import dagger.Module @@ -28,8 +26,7 @@ import javax.inject.Inject class FeatureFlagsReleaseStartable @Inject -constructor(@Application context: Context, dumpManager: DumpManager, featureFlags: FeatureFlags) : - CoreStartable(context) { +constructor(dumpManager: DumpManager, featureFlags: FeatureFlags) : CoreStartable { init { dumpManager.registerDumpable(FeatureFlagsRelease.TAG) { pw, args -> diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java index 74d5bd577cf4..9f321d83d292 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java @@ -36,8 +36,7 @@ import javax.inject.Provider; * Manages power menu plugins and communicates power menu actions to the CentralSurfaces. */ @SysUISingleton -public class GlobalActionsComponent extends CoreStartable - implements Callbacks, GlobalActionsManager { +public class GlobalActionsComponent implements CoreStartable, Callbacks, GlobalActionsManager { private final CommandQueue mCommandQueue; private final ExtensionController mExtensionController; @@ -48,11 +47,10 @@ public class GlobalActionsComponent extends CoreStartable private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Inject - public GlobalActionsComponent(Context context, CommandQueue commandQueue, + public GlobalActionsComponent(CommandQueue commandQueue, ExtensionController extensionController, Provider<GlobalActions> globalActionsProvider, StatusBarKeyguardViewManager statusBarKeyguardViewManager) { - super(context); mCommandQueue = commandQueue; mExtensionController = extensionController; mGlobalActionsProvider = globalActionsProvider; diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java index 568143c8df71..4f1a2b34f07c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java +++ b/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java @@ -27,7 +27,6 @@ import android.bluetooth.le.ScanSettings; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; -import android.content.res.Configuration; import android.hardware.input.InputManager; import android.os.Handler; import android.os.HandlerThread; @@ -66,7 +65,7 @@ import javax.inject.Provider; /** */ @SysUISingleton -public class KeyboardUI extends CoreStartable implements InputManager.OnTabletModeChangedListener { +public class KeyboardUI implements CoreStartable, InputManager.OnTabletModeChangedListener { private static final String TAG = "KeyboardUI"; private static final boolean DEBUG = false; @@ -127,13 +126,12 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo @Inject public KeyboardUI(Context context, Provider<LocalBluetoothManager> bluetoothManagerProvider) { - super(context); + mContext = context; this.mBluetoothManagerProvider = bluetoothManagerProvider; } @Override public void start() { - mContext = super.mContext; HandlerThread thread = new HandlerThread("Keyboard", Process.THREAD_PRIORITY_BACKGROUND); thread.start(); mHandler = new KeyboardHandler(thread.getLooper()); @@ -141,10 +139,6 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo } @Override - protected void onConfigurationChanged(Configuration newConfig) { - } - - @Override public void dump(PrintWriter pw, String[] args) { pw.println("KeyboardUI:"); pw.println(" mEnabled=" + mEnabled); @@ -156,7 +150,7 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo } @Override - protected void onBootCompleted() { + public void onBootCompleted() { mHandler.sendEmptyMessage(MSG_ON_BOOT_COMPLETED); } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 9a118e018bfd..9b036c166418 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -186,7 +186,7 @@ import dagger.Lazy; * directly to the keyguard UI is posted to a {@link android.os.Handler} to ensure it is taken on the UI * thread of the keyguard. */ -public class KeyguardViewMediator extends CoreStartable implements Dumpable, +public class KeyguardViewMediator implements CoreStartable, Dumpable, StatusBarStateController.StateListener { private static final int KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT = 30000; private static final long KEYGUARD_DONE_PENDING_TIMEOUT_MS = 3000; @@ -272,6 +272,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, private boolean mShuttingDown; private boolean mDozing; private boolean mAnimatingScreenOff; + private final Context mContext; private final FalsingCollector mFalsingCollector; /** High level access to the power manager for WakeLocks */ @@ -1128,7 +1129,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, DreamOverlayStateController dreamOverlayStateController, Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy, Lazy<ActivityLaunchAnimator> activityLaunchAnimator) { - super(context); + mContext = context; mFalsingCollector = falsingCollector; mLockPatternUtils = lockPatternUtils; mBroadcastDispatcher = broadcastDispatcher; diff --git a/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java b/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java index 8f9357abbba8..c7e4c5e93090 100644 --- a/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java +++ b/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java @@ -21,7 +21,6 @@ import static android.app.StatusBarManager.SESSION_BIOMETRIC_PROMPT; import static android.app.StatusBarManager.SESSION_KEYGUARD; import android.annotation.Nullable; -import android.content.Context; import android.os.RemoteException; import android.util.Log; @@ -48,7 +47,7 @@ import javax.inject.Inject; * session. Can be used across processes via StatusBarManagerService#registerSessionListener */ @SysUISingleton -public class SessionTracker extends CoreStartable { +public class SessionTracker implements CoreStartable { private static final String TAG = "SessionTracker"; private static final boolean DEBUG = false; @@ -65,13 +64,11 @@ public class SessionTracker extends CoreStartable { @Inject public SessionTracker( - Context context, IStatusBarService statusBarService, AuthController authController, KeyguardUpdateMonitor keyguardUpdateMonitor, KeyguardStateController keyguardStateController ) { - super(context); mStatusBarManagerService = statusBarService; mAuthController = authController; mKeyguardUpdateMonitor = keyguardUpdateMonitor; diff --git a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java index 0b9b32b0d7d7..2a8168b0cb36 100644 --- a/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java +++ b/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java @@ -51,9 +51,10 @@ import javax.inject.Inject; * {@link android.Manifest.permission#READ_EXTERNAL_STORAGE}. */ @SysUISingleton -public class RingtonePlayer extends CoreStartable { +public class RingtonePlayer implements CoreStartable { private static final String TAG = "RingtonePlayer"; private static final boolean LOGD = false; + private final Context mContext; // TODO: support Uri switching under same IBinder @@ -64,7 +65,7 @@ public class RingtonePlayer extends CoreStartable { @Inject public RingtonePlayer(Context context) { - super(context); + mContext = context; } @Override diff --git a/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamSentinel.java b/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamSentinel.java index 53b4d434bfcb..91e7b4933096 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamSentinel.java +++ b/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamSentinel.java @@ -18,7 +18,6 @@ package com.android.systemui.media.dream; import static com.android.systemui.flags.Flags.DREAM_MEDIA_COMPLICATION; -import android.content.Context; import android.util.Log; import androidx.annotation.NonNull; @@ -38,7 +37,7 @@ import javax.inject.Inject; * {@link MediaDreamSentinel} is responsible for tracking media state and registering/unregistering * the media complication as appropriate */ -public class MediaDreamSentinel extends CoreStartable { +public class MediaDreamSentinel implements CoreStartable { private static final String TAG = "MediaDreamSentinel"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); @@ -113,11 +112,10 @@ public class MediaDreamSentinel extends CoreStartable { private final FeatureFlags mFeatureFlags; @Inject - public MediaDreamSentinel(Context context, MediaDataManager mediaDataManager, + public MediaDreamSentinel(MediaDataManager mediaDataManager, DreamOverlayStateController dreamOverlayStateController, DreamMediaEntryComplication mediaEntryComplication, FeatureFlags featureFlags) { - super(context); mMediaDataManager = mediaDataManager; mDreamOverlayStateController = dreamOverlayStateController; mMediaEntryComplication = mediaEntryComplication; diff --git a/packages/SystemUI/src/com/android/systemui/media/systemsounds/HomeSoundEffectController.java b/packages/SystemUI/src/com/android/systemui/media/systemsounds/HomeSoundEffectController.java index d60172a17988..0ba5f28c351f 100644 --- a/packages/SystemUI/src/com/android/systemui/media/systemsounds/HomeSoundEffectController.java +++ b/packages/SystemUI/src/com/android/systemui/media/systemsounds/HomeSoundEffectController.java @@ -40,7 +40,7 @@ import javax.inject.Inject; * documented at {@link #handleTaskStackChanged} apply. */ @SysUISingleton -public class HomeSoundEffectController extends CoreStartable { +public class HomeSoundEffectController implements CoreStartable { private static final String TAG = "HomeSoundEffectController"; private final AudioManager mAudioManager; @@ -65,7 +65,6 @@ public class HomeSoundEffectController extends CoreStartable { TaskStackChangeListeners taskStackChangeListeners, ActivityManagerWrapper activityManagerWrapper, PackageManager packageManager) { - super(context); mAudioManager = audioManager; mTaskStackChangeListeners = taskStackChangeListeners; mActivityManagerWrapper = activityManagerWrapper; diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelper.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelper.kt index f5caefbf4ced..a4a968067462 100644 --- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelper.kt +++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/MediaTttCommandLineHelper.kt @@ -43,7 +43,7 @@ class MediaTttCommandLineHelper @Inject constructor( private val commandRegistry: CommandRegistry, private val context: Context, @Main private val mainExecutor: Executor -) : CoreStartable(context) { +) : CoreStartable { /** All commands for the sender device. */ inner class SenderCommand : Command { diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 67dae9e7a0ea..fae0b50bbf01 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -59,7 +59,7 @@ import javax.inject.Inject; import dagger.Lazy; @SysUISingleton -public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { +public class PowerUI implements CoreStartable, CommandQueue.Callbacks { static final String TAG = "PowerUI"; static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); @@ -103,6 +103,7 @@ public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { private IThermalEventListener mSkinThermalEventListener; private IThermalEventListener mUsbThermalEventListener; + private final Context mContext; private final BroadcastDispatcher mBroadcastDispatcher; private final CommandQueue mCommandQueue; private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; @@ -112,7 +113,7 @@ public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { CommandQueue commandQueue, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, WarningsUI warningsUI, EnhancedEstimates enhancedEstimates, PowerManager powerManager) { - super(context); + mContext = context; mBroadcastDispatcher = broadcastDispatcher; mCommandQueue = commandQueue; mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; @@ -169,7 +170,7 @@ public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { } @Override - protected void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(Configuration newConfig) { final int mask = ActivityInfo.CONFIG_MCC | ActivityInfo.CONFIG_MNC; // Safe to modify mLastConfiguration here as it's only updated by the main thread (here). diff --git a/packages/SystemUI/src/com/android/systemui/privacy/television/TvOngoingPrivacyChip.java b/packages/SystemUI/src/com/android/systemui/privacy/television/TvOngoingPrivacyChip.java index 5510eb172cd7..cd32a10a432b 100644 --- a/packages/SystemUI/src/com/android/systemui/privacy/television/TvOngoingPrivacyChip.java +++ b/packages/SystemUI/src/com/android/systemui/privacy/television/TvOngoingPrivacyChip.java @@ -67,7 +67,7 @@ import javax.inject.Inject; * recording audio, accessing the camera or accessing the location. */ @SysUISingleton -public class TvOngoingPrivacyChip extends CoreStartable implements PrivacyItemController.Callback, +public class TvOngoingPrivacyChip implements CoreStartable, PrivacyItemController.Callback, PrivacyChipDrawable.PrivacyChipDrawableListener { private static final String TAG = "TvOngoingPrivacyChip"; private static final boolean DEBUG = false; @@ -134,7 +134,6 @@ public class TvOngoingPrivacyChip extends CoreStartable implements PrivacyItemCo @Inject public TvOngoingPrivacyChip(Context context, PrivacyItemController privacyItemController, IWindowManager iWindowManager) { - super(context); if (DEBUG) Log.d(TAG, "Privacy chip running"); mContext = context; mPrivacyItemController = privacyItemController; diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index 9b3b843c9848..b041f957d771 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java @@ -29,13 +29,14 @@ import java.io.PrintWriter; /** * A proxy to a Recents implementation. */ -public class Recents extends CoreStartable implements CommandQueue.Callbacks { +public class Recents implements CoreStartable, CommandQueue.Callbacks { + private final Context mContext; private final RecentsImplementation mImpl; private final CommandQueue mCommandQueue; public Recents(Context context, RecentsImplementation impl, CommandQueue commandQueue) { - super(context); + mContext = context; mImpl = impl; mCommandQueue = commandQueue; } diff --git a/packages/SystemUI/src/com/android/systemui/settings/UserFileManagerImpl.kt b/packages/SystemUI/src/com/android/systemui/settings/UserFileManagerImpl.kt index ad073c073ed8..d450afa59c7d 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/UserFileManagerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/settings/UserFileManagerImpl.kt @@ -42,11 +42,11 @@ import javax.inject.Inject @SysUISingleton class UserFileManagerImpl @Inject constructor( // Context of system process and system user. - val context: Context, + private val context: Context, val userManager: UserManager, val broadcastDispatcher: BroadcastDispatcher, @Background val backgroundExecutor: DelayableExecutor -) : UserFileManager, CoreStartable(context) { +) : UserFileManager, CoreStartable { companion object { private const val FILES = "files" @VisibleForTesting internal const val SHARED_PREFS = "shared_prefs" diff --git a/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java b/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java index 6abf339685e4..ff26766fba66 100644 --- a/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java +++ b/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java @@ -32,10 +32,10 @@ import javax.inject.Inject; * Dispatches shortcut to System UI components */ @SysUISingleton -public class ShortcutKeyDispatcher extends CoreStartable - implements ShortcutKeyServiceProxy.Callbacks { +public class ShortcutKeyDispatcher implements CoreStartable, ShortcutKeyServiceProxy.Callbacks { private static final String TAG = "ShortcutKeyDispatcher"; + private final Context mContext; private ShortcutKeyServiceProxy mShortcutKeyServiceProxy = new ShortcutKeyServiceProxy(this); private IWindowManager mWindowManagerService = WindowManagerGlobal.getWindowManagerService(); @@ -50,7 +50,7 @@ public class ShortcutKeyDispatcher extends CoreStartable @Inject public ShortcutKeyDispatcher(Context context) { - super(context); + mContext = context; } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java index 59022c0ffbf2..822840dfd86b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/InstantAppNotifier.java @@ -66,11 +66,12 @@ import javax.inject.Inject; * splitted screen. */ @SysUISingleton -public class InstantAppNotifier extends CoreStartable - implements CommandQueue.Callbacks, KeyguardStateController.Callback { +public class InstantAppNotifier + implements CoreStartable, CommandQueue.Callbacks, KeyguardStateController.Callback { private static final String TAG = "InstantAppNotifier"; public static final int NUM_TASKS_FOR_INSTANT_APP_INFO = 5; + private final Context mContext; private final Handler mHandler = new Handler(); private final Executor mUiBgExecutor; private final ArraySet<Pair<String, Integer>> mCurrentNotifs = new ArraySet<>(); @@ -83,7 +84,7 @@ public class InstantAppNotifier extends CoreStartable CommandQueue commandQueue, @UiBackground Executor uiBgExecutor, KeyguardStateController keyguardStateController) { - super(context); + mContext = context; mCommandQueue = commandQueue; mUiBgExecutor = uiBgExecutor; mKeyguardStateController = keyguardStateController; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt index c956a2ea1836..659df24aad2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt @@ -72,7 +72,6 @@ private interface KeyguardNotificationVisibilityProviderImplModule { @SysUISingleton private class KeyguardNotificationVisibilityProviderImpl @Inject constructor( - context: Context, @Main private val handler: Handler, private val keyguardStateController: KeyguardStateController, private val lockscreenUserManager: NotificationLockscreenUserManager, @@ -82,7 +81,7 @@ private class KeyguardNotificationVisibilityProviderImpl @Inject constructor( private val broadcastDispatcher: BroadcastDispatcher, private val secureSettings: SecureSettings, private val globalSettings: GlobalSettings -) : CoreStartable(context), KeyguardNotificationVisibilityProvider { +) : CoreStartable, KeyguardNotificationVisibilityProvider { private val showSilentNotifsUri = secureSettings.getUriFor(Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS) private val onStateChangedListeners = ListenerSet<Consumer<String>>() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index f133c1902874..5f389f6babf3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -270,8 +270,7 @@ import dagger.Lazy; * </b> */ @SysUISingleton -public class CentralSurfacesImpl extends CoreStartable implements - CentralSurfaces { +public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { private static final String BANNER_ACTION_CANCEL = "com.android.systemui.statusbar.banner_action_cancel"; @@ -307,6 +306,7 @@ public class CentralSurfacesImpl extends CoreStartable implements ONLY_CORE_APPS = onlyCoreApps; } + private final Context mContext; private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; private CentralSurfacesCommandQueueCallbacks mCommandQueueCallbacks; private float mTransitionToFullShadeProgress = 0f; @@ -764,7 +764,7 @@ public class CentralSurfacesImpl extends CoreStartable implements DeviceStateManager deviceStateManager, WiredChargingRippleController wiredChargingRippleController, IDreamManager dreamManager) { - super(context); + mContext = context; mNotificationsController = notificationsController; mFragmentService = fragmentService; mLightBarController = lightBarController; @@ -3551,7 +3551,7 @@ public class CentralSurfacesImpl extends CoreStartable implements public void setBouncerShowingOverDream(boolean bouncerShowingOverDream) { mBouncerShowingOverDream = bouncerShowingOverDream; } - + /** * Propagate the bouncer state to status bar components. * diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt index e3e85728ff83..5e26cf062b58 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt @@ -47,7 +47,7 @@ class KeyguardLiftController @Inject constructor( private val asyncSensorManager: AsyncSensorManager, private val keyguardUpdateMonitor: KeyguardUpdateMonitor, private val dumpManager: DumpManager -) : Dumpable, CoreStartable(context) { +) : Dumpable, CoreStartable { private val pickupSensor = asyncSensorManager.getDefaultSensor(Sensor.TYPE_PICK_UP_GESTURE) private var isListening = false 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 09298b60ff51..b1b8341d9584 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java @@ -37,19 +37,20 @@ import dagger.Lazy; * Serves as a collection of UI components, rather than showing its own UI. */ @SysUISingleton -public class TvStatusBar extends CoreStartable implements CommandQueue.Callbacks { +public class TvStatusBar implements CoreStartable, CommandQueue.Callbacks { private static final String ACTION_SHOW_PIP_MENU = "com.android.wm.shell.pip.tv.notification.action.SHOW_PIP_MENU"; private static final String SYSTEMUI_PERMISSION = "com.android.systemui.permission.SELF"; + private final Context mContext; private final CommandQueue mCommandQueue; private final Lazy<AssistManager> mAssistManagerLazy; @Inject public TvStatusBar(Context context, CommandQueue commandQueue, Lazy<AssistManager> assistManagerLazy) { - super(context); + mContext = context; mCommandQueue = commandQueue; mAssistManagerLazy = assistManagerLazy; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt b/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt index c1997446c126..b938c9002d90 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt @@ -35,9 +35,9 @@ import javax.inject.Inject */ @SysUISingleton class VpnStatusObserver @Inject constructor( - context: Context, + private val context: Context, private val securityController: SecurityController -) : CoreStartable(context), +) : CoreStartable, SecurityController.SecurityControllerCallback { private var vpnConnected = false @@ -102,7 +102,7 @@ class VpnStatusObserver @Inject constructor( .apply { vpnName?.let { setContentText( - mContext.getString( + context.getString( R.string.notification_disclosure_vpn_text, it ) ) @@ -111,23 +111,23 @@ class VpnStatusObserver @Inject constructor( .build() private fun createVpnConnectedNotificationBuilder() = - Notification.Builder(mContext, NOTIFICATION_CHANNEL_TV_VPN) + Notification.Builder(context, NOTIFICATION_CHANNEL_TV_VPN) .setSmallIcon(vpnIconId) .setVisibility(Notification.VISIBILITY_PUBLIC) .setCategory(Notification.CATEGORY_SYSTEM) .extend(Notification.TvExtender()) .setOngoing(true) - .setContentTitle(mContext.getString(R.string.notification_vpn_connected)) - .setContentIntent(VpnConfig.getIntentForStatusPanel(mContext)) + .setContentTitle(context.getString(R.string.notification_vpn_connected)) + .setContentIntent(VpnConfig.getIntentForStatusPanel(context)) private fun createVpnDisconnectedNotification() = - Notification.Builder(mContext, NOTIFICATION_CHANNEL_TV_VPN) + Notification.Builder(context, NOTIFICATION_CHANNEL_TV_VPN) .setSmallIcon(vpnIconId) .setVisibility(Notification.VISIBILITY_PUBLIC) .setCategory(Notification.CATEGORY_SYSTEM) .extend(Notification.TvExtender()) .setTimeoutAfter(VPN_DISCONNECTED_NOTIFICATION_TIMEOUT_MS) - .setContentTitle(mContext.getString(R.string.notification_vpn_disconnected)) + .setContentTitle(context.getString(R.string.notification_vpn_disconnected)) .build() companion object { @@ -137,4 +137,4 @@ class VpnStatusObserver @Inject constructor( private const val TAG = "TvVpnNotification" private const val VPN_DISCONNECTED_NOTIFICATION_TIMEOUT_MS = 5_000L } -}
\ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationHandler.java index 8026ba517820..b92725bd7cf7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationHandler.java @@ -18,13 +18,13 @@ package com.android.systemui.statusbar.tv.notifications; import android.annotation.Nullable; import android.app.Notification; -import android.content.Context; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.util.Log; import android.util.SparseArray; import com.android.systemui.CoreStartable; +import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.NotificationListener; import javax.inject.Inject; @@ -32,7 +32,8 @@ import javax.inject.Inject; /** * Keeps track of the notifications on TV. */ -public class TvNotificationHandler extends CoreStartable implements +@SysUISingleton +public class TvNotificationHandler implements CoreStartable, NotificationListener.NotificationHandler { private static final String TAG = "TvNotificationHandler"; private final NotificationListener mNotificationListener; @@ -41,8 +42,7 @@ public class TvNotificationHandler extends CoreStartable implements private Listener mUpdateListener; @Inject - public TvNotificationHandler(Context context, NotificationListener notificationListener) { - super(context); + public TvNotificationHandler(NotificationListener notificationListener) { mNotificationListener = notificationListener; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java index 892fedcc8ce2..dbbd0b8613de 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java @@ -35,14 +35,15 @@ import javax.inject.Inject; * Offers control methods for the notification panel handler on TV devices. */ @SysUISingleton -public class TvNotificationPanel extends CoreStartable implements CommandQueue.Callbacks { +public class TvNotificationPanel implements CoreStartable, CommandQueue.Callbacks { private static final String TAG = "TvNotificationPanel"; + private final Context mContext; private final CommandQueue mCommandQueue; private final String mNotificationHandlerPackage; @Inject public TvNotificationPanel(Context context, CommandQueue commandQueue) { - super(context); + mContext = context; mCommandQueue = commandQueue; mNotificationHandlerPackage = mContext.getResources().getString( com.android.internal.R.string.config_notificationHandlerPackage); diff --git a/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt b/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt index 4450b76a878c..5cbdf7c43a12 100644 --- a/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt +++ b/packages/SystemUI/src/com/android/systemui/temporarydisplay/TemporaryViewDisplayController.kt @@ -62,7 +62,7 @@ abstract class TemporaryViewDisplayController<T : TemporaryViewInfo, U : Tempora @LayoutRes private val viewLayoutRes: Int, private val windowTitle: String, private val wakeReason: String, -) : CoreStartable(context) { +) : CoreStartable { /** * Window layout params that will be used as a starting point for the [windowLayoutParams] of * all subclasses. diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java index a345d99b47c6..3d56f2317660 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java @@ -100,7 +100,7 @@ import javax.inject.Inject; * associated work profiles */ @SysUISingleton -public class ThemeOverlayController extends CoreStartable implements Dumpable { +public class ThemeOverlayController implements CoreStartable, Dumpable { protected static final String TAG = "ThemeOverlayController"; private static final boolean DEBUG = true; @@ -114,6 +114,7 @@ public class ThemeOverlayController extends CoreStartable implements Dumpable { private final SecureSettings mSecureSettings; private final Executor mMainExecutor; private final Handler mBgHandler; + private final Context mContext; private final boolean mIsMonetEnabled; private final UserTracker mUserTracker; private final DeviceProvisionedController mDeviceProvisionedController; @@ -361,8 +362,7 @@ public class ThemeOverlayController extends CoreStartable implements Dumpable { UserManager userManager, DeviceProvisionedController deviceProvisionedController, UserTracker userTracker, DumpManager dumpManager, FeatureFlags featureFlags, @Main Resources resources, WakefulnessLifecycle wakefulnessLifecycle) { - super(context); - + mContext = context; mIsMonetEnabled = featureFlags.isEnabled(Flags.MONET); mDeviceProvisionedController = deviceProvisionedController; mBroadcastDispatcher = broadcastDispatcher; diff --git a/packages/SystemUI/src/com/android/systemui/toast/ToastUI.java b/packages/SystemUI/src/com/android/systemui/toast/ToastUI.java index 9eb34a42a0a9..ed14c8ad150c 100644 --- a/packages/SystemUI/src/com/android/systemui/toast/ToastUI.java +++ b/packages/SystemUI/src/com/android/systemui/toast/ToastUI.java @@ -50,13 +50,14 @@ import javax.inject.Inject; * Controls display of text toasts. */ @SysUISingleton -public class ToastUI extends CoreStartable implements CommandQueue.Callbacks { +public class ToastUI implements CoreStartable, CommandQueue.Callbacks { // values from NotificationManagerService#LONG_DELAY and NotificationManagerService#SHORT_DELAY private static final int TOAST_LONG_TIME = 3500; // 3.5 seconds private static final int TOAST_SHORT_TIME = 2000; // 2 seconds private static final String TAG = "ToastUI"; + private final Context mContext; private final CommandQueue mCommandQueue; private final INotificationManager mNotificationManager; private final IAccessibilityManager mIAccessibilityManager; @@ -90,7 +91,7 @@ public class ToastUI extends CoreStartable implements CommandQueue.Callbacks { @Nullable IAccessibilityManager accessibilityManager, ToastFactory toastFactory, ToastLogger toastLogger ) { - super(context); + mContext = context; mCommandQueue = commandQueue; mNotificationManager = notificationManager; mIAccessibilityManager = accessibilityManager; @@ -179,7 +180,7 @@ public class ToastUI extends CoreStartable implements CommandQueue.Callbacks { } @Override - protected void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(Configuration newConfig) { if (newConfig.orientation != mOrientation) { mOrientation = newConfig.orientation; if (mToast != null) { diff --git a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java index 3ce5ca3d0301..10a09dd169e8 100644 --- a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java @@ -203,9 +203,9 @@ public abstract class TvSystemUIModule { @Provides @SysUISingleton - static TvNotificationHandler provideTvNotificationHandler(Context context, + static TvNotificationHandler provideTvNotificationHandler( NotificationListener notificationListener) { - return new TvNotificationHandler(context, notificationListener); + return new TvNotificationHandler(notificationListener); } /** diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index 4dc78f9ec8a6..bf706735d531 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -21,7 +21,6 @@ import android.app.Notification; import android.app.Notification.Action; import android.app.NotificationManager; import android.app.PendingIntent; -import android.app.ActivityManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -56,11 +55,12 @@ import javax.inject.Inject; /** */ @SysUISingleton -public class StorageNotification extends CoreStartable { +public class StorageNotification implements CoreStartable { private static final String TAG = "StorageNotification"; private static final String ACTION_SNOOZE_VOLUME = "com.android.systemui.action.SNOOZE_VOLUME"; private static final String ACTION_FINISH_WIZARD = "com.android.systemui.action.FINISH_WIZARD"; + private final Context mContext; // TODO: delay some notifications to avoid bumpy fast operations @@ -69,7 +69,7 @@ public class StorageNotification extends CoreStartable { @Inject public StorageNotification(Context context) { - super(context); + mContext = context; } private static class MoveInfo { diff --git a/packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitcherDialogCoordinator.kt b/packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitcherDialogCoordinator.kt index 6e7b5232d818..91c592177d19 100644 --- a/packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitcherDialogCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/user/ui/dialog/UserSwitcherDialogCoordinator.kt @@ -48,7 +48,7 @@ constructor( private val dialogLaunchAnimator: DialogLaunchAnimator, private val interactor: UserInteractor, private val featureFlags: FeatureFlags, -) : CoreStartable(context) { +) : CoreStartable { private var currentDialog: Dialog? = null diff --git a/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java b/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java index 53da213eb38e..2efeda932ff3 100644 --- a/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java +++ b/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java @@ -32,7 +32,8 @@ import java.util.Arrays; import javax.inject.Inject; // NOT Singleton. Started per-user. -public class NotificationChannels extends CoreStartable { +/** */ +public class NotificationChannels implements CoreStartable { public static String ALERTS = "ALR"; public static String SCREENSHOTS_HEADSUP = "SCN_HEADSUP"; // Deprecated. Please use or create a more specific channel that users will better understand @@ -45,9 +46,11 @@ public class NotificationChannels extends CoreStartable { public static String INSTANT = "INS"; public static String SETUP = "STP"; + private final Context mContext; + @Inject public NotificationChannels(Context context) { - super(context); + mContext = context; } public static void createAll(Context context) { diff --git a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java index 619e50b47f13..a0a0372426ec 100644 --- a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java +++ b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java @@ -564,12 +564,13 @@ public class GarbageMonitor implements Dumpable { /** */ @SysUISingleton - public static class Service extends CoreStartable implements Dumpable { + public static class Service implements CoreStartable, Dumpable { + private final Context mContext; private final GarbageMonitor mGarbageMonitor; @Inject public Service(Context context, GarbageMonitor garbageMonitor) { - super(context); + mContext = context; mGarbageMonitor = garbageMonitor; } diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java index 87fb2a692682..0b3521b048c4 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java @@ -31,18 +31,19 @@ import java.io.PrintWriter; import javax.inject.Inject; @SysUISingleton -public class VolumeUI extends CoreStartable { +public class VolumeUI implements CoreStartable { private static final String TAG = "VolumeUI"; private static boolean LOGD = Log.isLoggable(TAG, Log.DEBUG); private final Handler mHandler = new Handler(); private boolean mEnabled; + private final Context mContext; private VolumeDialogComponent mVolumeComponent; @Inject public VolumeUI(Context context, VolumeDialogComponent volumeDialogComponent) { - super(context); + mContext = context; mVolumeComponent = volumeDialogComponent; } @@ -59,8 +60,7 @@ public class VolumeUI extends CoreStartable { } @Override - protected void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); + public void onConfigurationChanged(Configuration newConfig) { if (!mEnabled) return; mVolumeComponent.onConfigurationChanged(newConfig); } diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java index 3472cb1c2a7d..fbc6a582da2e 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java @@ -89,8 +89,10 @@ import javax.inject.Inject; * -> WMShell starts and binds SysUI with Shell components via exported Shell interfaces */ @SysUISingleton -public final class WMShell extends CoreStartable - implements CommandQueue.Callbacks, ProtoTraceable<SystemUiTraceProto> { +public final class WMShell implements + CoreStartable, + CommandQueue.Callbacks, + ProtoTraceable<SystemUiTraceProto> { private static final String TAG = WMShell.class.getName(); private static final int INVALID_SYSUI_STATE_MASK = SYSUI_STATE_DIALOG_SHOWING @@ -102,6 +104,7 @@ public final class WMShell extends CoreStartable | SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; + private final Context mContext; // Shell interfaces private final ShellInterface mShell; private final Optional<Pip> mPipOptional; @@ -163,7 +166,8 @@ public final class WMShell extends CoreStartable private WakefulnessLifecycle.Observer mWakefulnessObserver; @Inject - public WMShell(Context context, + public WMShell( + Context context, ShellInterface shell, Optional<Pip> pipOptional, Optional<SplitScreen> splitScreenOptional, @@ -179,7 +183,7 @@ public final class WMShell extends CoreStartable WakefulnessLifecycle wakefulnessLifecycle, UserTracker userTracker, @Main Executor sysUiMainExecutor) { - super(context); + mContext = context; mShell = shell; mCommandQueue = commandQueue; mConfigurationController = configurationController; diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardBiometricLockoutLoggerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardBiometricLockoutLoggerTest.kt index aa671d1e3790..91b544b8265c 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardBiometricLockoutLoggerTest.kt +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardBiometricLockoutLoggerTest.kt @@ -17,7 +17,6 @@ package com.android.keyguard import android.hardware.biometrics.BiometricSourceType -import org.mockito.Mockito.verify import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest import com.android.internal.logging.InstanceId @@ -30,9 +29,10 @@ import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor -import org.mockito.Captor import org.mockito.ArgumentMatchers.anyInt +import org.mockito.Captor import org.mockito.Mock +import org.mockito.Mockito.verify import org.mockito.Mockito.verifyNoMoreInteractions import org.mockito.Mockito.`when` as whenever import org.mockito.MockitoAnnotations @@ -63,7 +63,6 @@ class KeyguardBiometricLockoutLoggerTest : SysuiTestCase() { whenever(keyguardUpdateMonitor.strongAuthTracker).thenReturn(strongAuthTracker) whenever(sessionTracker.getSessionId(anyInt())).thenReturn(sessionId) keyguardBiometricLockoutLogger = KeyguardBiometricLockoutLogger( - mContext, uiEventLogger, keyguardUpdateMonitor, sessionTracker) @@ -195,4 +194,4 @@ class KeyguardBiometricLockoutLoggerTest : SysuiTestCase() { verify(keyguardUpdateMonitor).registerCallback(updateMonitorCallbackCaptor.capture()) updateMonitorCallback = updateMonitorCallbackCaptor.value } -}
\ No newline at end of file +} diff --git a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java index df10dfe9f160..2319f4386798 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java @@ -231,7 +231,7 @@ public class ScreenDecorationsTest extends SysuiTestCase { } @Override - protected void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mExecutor.runAllReady(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/ComplicationTypesUpdaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/ComplicationTypesUpdaterTest.java index 571dd3d1faf3..9f4a7c820efc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/ComplicationTypesUpdaterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/ComplicationTypesUpdaterTest.java @@ -71,7 +71,7 @@ public class ComplicationTypesUpdaterTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); when(mDreamBackend.getEnabledComplications()).thenReturn(new HashSet<>()); - mController = new ComplicationTypesUpdater(mContext, mDreamBackend, mExecutor, + mController = new ComplicationTypesUpdater(mDreamBackend, mExecutor, mSecureSettings, mDreamOverlayStateController); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamClockTimeComplicationTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamClockTimeComplicationTest.java index 314a30b2d14a..ec448f94ba83 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamClockTimeComplicationTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamClockTimeComplicationTest.java @@ -82,7 +82,6 @@ public class DreamClockTimeComplicationTest extends SysuiTestCase { public void testComplicationAdded() { final DreamClockTimeComplication.Registrant registrant = new DreamClockTimeComplication.Registrant( - mContext, mDreamOverlayStateController, mComplication); registrant.start(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamHomeControlsComplicationTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamHomeControlsComplicationTest.java index db6082d52501..aa8c93edce68 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamHomeControlsComplicationTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/DreamHomeControlsComplicationTest.java @@ -115,7 +115,7 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase { @Test public void complicationAvailability_serviceNotAvailable_noFavorites_doNotAddComplication() { final DreamHomeControlsComplication.Registrant registrant = - new DreamHomeControlsComplication.Registrant(mContext, mComplication, + new DreamHomeControlsComplication.Registrant(mComplication, mDreamOverlayStateController, mControlsComponent); registrant.start(); @@ -128,7 +128,7 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase { @Test public void complicationAvailability_serviceAvailable_noFavorites_doNotAddComplication() { final DreamHomeControlsComplication.Registrant registrant = - new DreamHomeControlsComplication.Registrant(mContext, mComplication, + new DreamHomeControlsComplication.Registrant(mComplication, mDreamOverlayStateController, mControlsComponent); registrant.start(); @@ -141,7 +141,7 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase { @Test public void complicationAvailability_serviceNotAvailable_haveFavorites_doNotAddComplication() { final DreamHomeControlsComplication.Registrant registrant = - new DreamHomeControlsComplication.Registrant(mContext, mComplication, + new DreamHomeControlsComplication.Registrant(mComplication, mDreamOverlayStateController, mControlsComponent); registrant.start(); @@ -154,7 +154,7 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase { @Test public void complicationAvailability_serviceAvailable_haveFavorites_addComplication() { final DreamHomeControlsComplication.Registrant registrant = - new DreamHomeControlsComplication.Registrant(mContext, mComplication, + new DreamHomeControlsComplication.Registrant(mComplication, mDreamOverlayStateController, mControlsComponent); registrant.start(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/SmartSpaceComplicationTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/SmartSpaceComplicationTest.java index fa8f88a08368..c8b2b2556828 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/SmartSpaceComplicationTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/complication/SmartSpaceComplicationTest.java @@ -24,7 +24,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.app.smartspace.SmartspaceTarget; -import android.content.Context; import android.testing.AndroidTestingRunner; import android.view.View; @@ -48,8 +47,6 @@ import java.util.Collections; @SmallTest @RunWith(AndroidTestingRunner.class) public class SmartSpaceComplicationTest extends SysuiTestCase { - @Mock - private Context mContext; @Mock private DreamSmartspaceController mSmartspaceController; @@ -80,7 +77,6 @@ public class SmartSpaceComplicationTest extends SysuiTestCase { private SmartSpaceComplication.Registrant getRegistrant() { return new SmartSpaceComplication.Registrant( - mContext, mDreamOverlayStateController, mComplication, mSmartspaceController); diff --git a/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java index b8e9cf48f3e2..dc5522efe406 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java @@ -82,7 +82,6 @@ public class SessionTrackerTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); mSessionTracker = new SessionTracker( - mContext, mStatusBarService, mAuthController, mKeyguardUpdateMonitor, diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dream/MediaDreamSentinelTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dream/MediaDreamSentinelTest.java index 2f52950a9ee4..af530163e289 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/dream/MediaDreamSentinelTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/media/dream/MediaDreamSentinelTest.java @@ -73,7 +73,7 @@ public class MediaDreamSentinelTest extends SysuiTestCase { @Test public void testOnMediaDataLoaded_complicationAddition() { - final MediaDreamSentinel sentinel = new MediaDreamSentinel(mContext, mMediaDataManager, + final MediaDreamSentinel sentinel = new MediaDreamSentinel(mMediaDataManager, mDreamOverlayStateController, mMediaEntryComplication, mFeatureFlags); sentinel.start(); @@ -94,7 +94,7 @@ public class MediaDreamSentinelTest extends SysuiTestCase { @Test public void testOnMediaDataRemoved_complicationRemoval() { - final MediaDreamSentinel sentinel = new MediaDreamSentinel(mContext, mMediaDataManager, + final MediaDreamSentinel sentinel = new MediaDreamSentinel(mMediaDataManager, mDreamOverlayStateController, mMediaEntryComplication, mFeatureFlags); sentinel.start(); @@ -114,7 +114,7 @@ public class MediaDreamSentinelTest extends SysuiTestCase { @Test public void testOnMediaDataLoaded_complicationRemoval() { - final MediaDreamSentinel sentinel = new MediaDreamSentinel(mContext, mMediaDataManager, + final MediaDreamSentinel sentinel = new MediaDreamSentinel(mMediaDataManager, mDreamOverlayStateController, mMediaEntryComplication, mFeatureFlags); sentinel.start(); @@ -139,7 +139,7 @@ public class MediaDreamSentinelTest extends SysuiTestCase { public void testOnMediaDataLoaded_mediaComplicationDisabled_doesNotAddComplication() { when(mFeatureFlags.isEnabled(DREAM_MEDIA_COMPLICATION)).thenReturn(false); - final MediaDreamSentinel sentinel = new MediaDreamSentinel(mContext, mMediaDataManager, + final MediaDreamSentinel sentinel = new MediaDreamSentinel(mMediaDataManager, mDreamOverlayStateController, mMediaEntryComplication, mFeatureFlags); sentinel.start(); |