Merge "Make CoreStartable an Interface."

This commit is contained in:
Dave Mankoff
2022-10-13 22:14:05 +00:00
committed by Android (Google) Code Review
59 changed files with 170 additions and 197 deletions

View File

@@ -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
}
}
}
}

View File

@@ -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(

View File

@@ -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>
* &#64;Binds
* &#64;IntoMap
* &#64;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() {
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -45,8 +45,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;
@@ -287,14 +285,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);
}

View File

@@ -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

View File

@@ -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;

View File

@@ -53,11 +53,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;
@@ -108,7 +109,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;

View File

@@ -104,7 +104,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";
@@ -112,6 +112,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;
@@ -697,7 +698,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
@Main Handler handler,
@Background DelayableExecutor bgExecutor,
@NonNull VibratorHelper vibrator) {
super(context);
mContext = context;
mExecution = execution;
mUserManager = userManager;
mLockPatternUtils = lockPatternUtils;
@@ -1152,8 +1153,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)

View File

@@ -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()
}
}
}

View File

@@ -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;

View File

@@ -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));

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 ->

View File

@@ -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 ->

View File

@@ -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;

View File

@@ -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,23 +126,18 @@ 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());
mHandler.sendEmptyMessage(MSG_INIT);
}
@Override
protected void onConfigurationChanged(Configuration newConfig) {
}
@Override
public void dump(PrintWriter pw, String[] args) {
pw.println("KeyboardUI:");
@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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).

View File

@@ -70,8 +70,8 @@ import javax.inject.Inject;
* recording audio, camera, the screen, or accessing the location.
*/
@SysUISingleton
public class TvPrivacyChipsController extends CoreStartable
implements PrivacyItemController.Callback {
public class TvPrivacyChipsController
implements CoreStartable, PrivacyItemController.Callback {
private static final String TAG = "TvPrivacyChipsController";
private static final boolean DEBUG = false;
@@ -106,6 +106,7 @@ public class TvPrivacyChipsController extends CoreStartable
// How long chips stay expanded after an update.
private static final int EXPANDED_DURATION_MS = 4000;
private final Context mContext;
private final Handler mUiThreadHandler = new Handler(Looper.getMainLooper());
private final Runnable mCollapseRunnable = this::collapseChips;
private final Runnable mUpdatePrivacyItemsRunnable = this::updateChipsAndAnnounce;
@@ -130,7 +131,7 @@ public class TvPrivacyChipsController extends CoreStartable
@Inject
public TvPrivacyChipsController(Context context, PrivacyItemController privacyItemController,
IWindowManager iWindowManager) {
super(context);
mContext = context;
if (DEBUG) Log.d(TAG, "TvPrivacyChipsController running");
mPrivacyItemController = privacyItemController;
mIWindowManager = iWindowManager;

View File

@@ -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;
}

View File

@@ -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"

View File

@@ -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;
}
/**

View File

@@ -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;

View File

@@ -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>>()

View File

@@ -268,8 +268,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";
@@ -290,6 +289,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
private static final UiEventLogger sUiEventLogger = new UiEventLoggerImpl();
private final Context mContext;
private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
private CentralSurfacesCommandQueueCallbacks mCommandQueueCallbacks;
private float mTransitionToFullShadeProgress = 0f;
@@ -747,7 +747,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
DeviceStateManager deviceStateManager,
WiredChargingRippleController wiredChargingRippleController,
IDreamManager dreamManager) {
super(context);
mContext = context;
mNotificationsController = notificationsController;
mFragmentService = fragmentService;
mLightBarController = lightBarController;

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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
}
}
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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.

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);
}
/**

View File

@@ -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 {

View File

@@ -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

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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
}
}
}

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -82,7 +82,6 @@ public class DreamClockTimeComplicationTest extends SysuiTestCase {
public void testComplicationAdded() {
final DreamClockTimeComplication.Registrant registrant =
new DreamClockTimeComplication.Registrant(
mContext,
mDreamOverlayStateController,
mComplication);
registrant.start();

View File

@@ -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();

View File

@@ -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);

View File

@@ -82,7 +82,6 @@ public class SessionTrackerTest extends SysuiTestCase {
MockitoAnnotations.initMocks(this);
mSessionTracker = new SessionTracker(
mContext,
mStatusBarService,
mAuthController,
mKeyguardUpdateMonitor,

View File

@@ -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();