Conslidate @MainHandler and similar to @Main (and similar).
@MainHandler, @MainLooper, @MainResources -> @Main @BgHandler, @BgLooper -> @Background. Also, move the providers for Handlers and Loopers into the ConcurrencyModule. Bug: 146510722 Test: atest SystemUITests Change-Id: I991735e1fdca397784427409a2ae696a7374f584
This commit is contained in:
@@ -27,7 +27,7 @@ import android.provider.Settings;
|
||||
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedControllerImpl;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -54,7 +54,7 @@ public class CarDeviceProvisionedControllerImpl extends DeviceProvisionedControl
|
||||
private final ContentResolver mContentResolver;
|
||||
|
||||
@Inject
|
||||
public CarDeviceProvisionedControllerImpl(Context context, @MainHandler Handler mainHandler,
|
||||
public CarDeviceProvisionedControllerImpl(Context context, @Main Handler mainHandler,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
super(context, mainHandler, broadcastDispatcher);
|
||||
mContentResolver = context.getContentResolver();
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.car.CarDeviceProvisionedController;
|
||||
import com.android.systemui.car.CarDeviceProvisionedListener;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NavigationBarController;
|
||||
@@ -93,7 +93,7 @@ public class CarNavigationBar extends SystemUI implements CommandQueue.Callbacks
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
CommandQueue commandQueue,
|
||||
Lazy<FacetButtonTaskStackListener> facetButtonTaskStackListenerLazy,
|
||||
@MainHandler Handler mainHandler,
|
||||
@Main Handler mainHandler,
|
||||
Lazy<KeyguardStateController> keyguardStateControllerLazy,
|
||||
Lazy<NavigationBarController> navigationBarControllerLazy,
|
||||
SuperStatusBarViewFactory superStatusBarViewFactory,
|
||||
|
||||
@@ -37,7 +37,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@@ -68,7 +68,7 @@ class CarTrustAgentUnlockDialogHelper extends BroadcastReceiver{
|
||||
private OnHideListener mOnHideListener;
|
||||
|
||||
@Inject
|
||||
CarTrustAgentUnlockDialogHelper(Context context, @MainResources Resources resources,
|
||||
CarTrustAgentUnlockDialogHelper(Context context, @Main Resources resources,
|
||||
UserManager userManager, WindowManager windowManager) {
|
||||
mContext = context;
|
||||
mResources = resources;
|
||||
|
||||
@@ -38,7 +38,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.car.CarServiceProvider;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.car.CarTrustAgentUnlockDialogHelper.OnHideListener;
|
||||
import com.android.systemui.statusbar.car.UserGridRecyclerView.UserRecord;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class FullscreenUserSwitcher {
|
||||
@Inject
|
||||
public FullscreenUserSwitcher(
|
||||
Context context,
|
||||
@MainResources Resources resources,
|
||||
@Main Resources resources,
|
||||
UserManager userManager,
|
||||
CarServiceProvider carServiceProvider,
|
||||
CarTrustAgentUnlockDialogHelper carTrustAgentUnlockDialogHelper) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.settingslib.WirelessUtils;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||
|
||||
import java.util.List;
|
||||
@@ -608,7 +608,7 @@ public class CarrierTextController {
|
||||
private boolean mShowMissingSim;
|
||||
|
||||
@Inject
|
||||
public Builder(Context context, @MainResources Resources resources) {
|
||||
public Builder(Context context, @Main Resources resources) {
|
||||
mContext = context;
|
||||
mSeparator = resources.getString(
|
||||
com.android.internal.R.string.kg_text_message_separator);
|
||||
|
||||
@@ -101,7 +101,7 @@ import com.android.systemui.DumpController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.TaskStackChangeListener;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
@@ -1496,7 +1496,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
|
||||
@VisibleForTesting
|
||||
@Inject
|
||||
protected KeyguardUpdateMonitor(Context context, @MainLooper Looper mainLooper,
|
||||
protected KeyguardUpdateMonitor(Context context, @Main Looper mainLooper,
|
||||
BroadcastDispatcher broadcastDispatcher,
|
||||
DumpController dumpController) {
|
||||
mContext = context;
|
||||
|
||||
@@ -39,10 +39,8 @@ import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.dock.DockManager;
|
||||
import com.android.systemui.fragments.FragmentService;
|
||||
import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
@@ -297,10 +295,10 @@ public class Dependency {
|
||||
@Inject Lazy<SensorPrivacyManager> mSensorPrivacyManager;
|
||||
@Inject Lazy<AutoHideController> mAutoHideController;
|
||||
@Inject Lazy<ForegroundServiceNotificationListener> mForegroundServiceNotificationListener;
|
||||
@Inject @BgLooper Lazy<Looper> mBgLooper;
|
||||
@Inject @BgHandler Lazy<Handler> mBgHandler;
|
||||
@Inject @MainLooper Lazy<Looper> mMainLooper;
|
||||
@Inject @MainHandler Lazy<Handler> mMainHandler;
|
||||
@Inject @Background Lazy<Looper> mBgLooper;
|
||||
@Inject @Background Lazy<Handler> mBgHandler;
|
||||
@Inject @Main Lazy<Looper> mMainLooper;
|
||||
@Inject @Main Lazy<Handler> mMainHandler;
|
||||
@Inject @Named(TIME_TICK_HANDLER_NAME) Lazy<Handler> mTimeTickHandler;
|
||||
@Nullable
|
||||
@Inject @Named(LEAK_REPORT_EMAIL_NAME) Lazy<String> mLeakReportEmail;
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.util.SparseArray;
|
||||
|
||||
import com.android.internal.messages.nano.SystemMessageProto;
|
||||
import com.android.systemui.appops.AppOpsController;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.util.Assert;
|
||||
@@ -50,7 +50,7 @@ public class ForegroundServiceController {
|
||||
|
||||
@Inject
|
||||
public ForegroundServiceController(NotificationEntryManager entryManager,
|
||||
AppOpsController appOpsController, @MainHandler Handler mainHandler) {
|
||||
AppOpsController appOpsController, @Main Handler mainHandler) {
|
||||
mEntryManager = entryManager;
|
||||
mMainHandler = mainHandler;
|
||||
appOpsController.addCallback(APP_OPS, (code, uid, packageName, active) -> {
|
||||
|
||||
@@ -68,7 +68,7 @@ import androidx.annotation.VisibleForTesting;
|
||||
import com.android.internal.util.Preconditions;
|
||||
import com.android.systemui.RegionInterceptingFrameLayout.RegionInterceptableView;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.fragments.FragmentHostManager;
|
||||
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
@@ -147,7 +147,7 @@ public class ScreenDecorations extends SystemUI implements Tunable {
|
||||
@Inject
|
||||
public ScreenDecorations(Context context,
|
||||
Lazy<StatusBar> statusBarLazy,
|
||||
@MainHandler Handler handler,
|
||||
@Main Handler handler,
|
||||
BroadcastDispatcher broadcastDispatcher,
|
||||
TunerService tunerService) {
|
||||
super(context);
|
||||
|
||||
@@ -27,7 +27,7 @@ import android.os.SystemProperties;
|
||||
import android.util.Slog;
|
||||
|
||||
import com.android.internal.os.BinderInternal;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.shared.plugins.PluginManagerImpl;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SystemUIService extends Service {
|
||||
private final Handler mMainHandler;
|
||||
|
||||
@Inject
|
||||
public SystemUIService(@MainHandler Handler mainHandler) {
|
||||
public SystemUIService(@Main Handler mainHandler) {
|
||||
super();
|
||||
mMainHandler = mainHandler;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@@ -36,7 +36,7 @@ public class WindowMagnification extends SystemUI {
|
||||
private final Handler mHandler;
|
||||
|
||||
@Inject
|
||||
public WindowMagnification(Context context, @MainHandler Handler mainHandler) {
|
||||
public WindowMagnification(Context context, @Main Handler mainHandler) {
|
||||
super(context);
|
||||
mHandler = mainHandler;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.systemui.DumpController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
@@ -81,7 +81,7 @@ public class AppOpsControllerImpl implements AppOpsController,
|
||||
};
|
||||
|
||||
@Inject
|
||||
public AppOpsControllerImpl(Context context, @BgLooper Looper bgLooper,
|
||||
public AppOpsControllerImpl(Context context, @Background Looper bgLooper,
|
||||
DumpController dumpController) {
|
||||
this(context, bgLooper, new PermissionFlagsCache(context), dumpController);
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ import android.util.Log
|
||||
import android.util.SparseArray
|
||||
import com.android.internal.annotations.VisibleForTesting
|
||||
import com.android.systemui.Dumpable
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler
|
||||
import com.android.systemui.dagger.qualifiers.Background
|
||||
import com.android.systemui.dagger.qualifiers.Main
|
||||
import java.io.FileDescriptor
|
||||
import java.io.PrintWriter
|
||||
import javax.inject.Inject
|
||||
@@ -62,8 +62,8 @@ private const val DEBUG = true
|
||||
@Singleton
|
||||
open class BroadcastDispatcher @Inject constructor (
|
||||
private val context: Context,
|
||||
@MainHandler private val mainHandler: Handler,
|
||||
@BgLooper private val bgLooper: Looper
|
||||
@Main private val mainHandler: Handler,
|
||||
@Background private val bgLooper: Looper
|
||||
) : Dumpable {
|
||||
|
||||
// Only modify in BG thread
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.classifier.brightline.BrightLineFalsingManager;
|
||||
import com.android.systemui.classifier.brightline.FalsingDataProvider;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.FalsingPlugin;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
@@ -61,7 +61,7 @@ public class FalsingManagerProxy implements FalsingManager {
|
||||
|
||||
@Inject
|
||||
FalsingManagerProxy(Context context, PluginManager pluginManager,
|
||||
@MainHandler Handler handler,
|
||||
@Main Handler handler,
|
||||
ProximitySensor proximitySensor,
|
||||
DeviceConfigProxy deviceConfig) {
|
||||
mProximitySensor = proximitySensor;
|
||||
|
||||
@@ -25,8 +25,6 @@ import android.hardware.display.AmbientDisplayConfiguration;
|
||||
import android.hardware.display.NightDisplayListener;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.os.ServiceManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.IWindowManager;
|
||||
@@ -35,10 +33,8 @@ import android.view.LayoutInflater;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.keyguard.ViewMediatorCallback;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.doze.AlwaysOnDisplayPolicy;
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.plugins.PluginInitializerImpl;
|
||||
@@ -82,35 +78,6 @@ public class DependencyProvider {
|
||||
return new Handler(thread.getLooper());
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@BgLooper
|
||||
public Looper provideBgLooper() {
|
||||
HandlerThread thread = new HandlerThread("SysUiBg",
|
||||
Process.THREAD_PRIORITY_BACKGROUND);
|
||||
thread.start();
|
||||
return thread.getLooper();
|
||||
}
|
||||
|
||||
/** Main Looper */
|
||||
@Provides
|
||||
@MainLooper
|
||||
public Looper provideMainLooper() {
|
||||
return Looper.getMainLooper();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@BgHandler
|
||||
public Handler provideBgHandler(@BgLooper Looper bgLooper) {
|
||||
return new Handler(bgLooper);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@MainHandler
|
||||
public Handler provideMainHandler(@MainLooper Looper mainLooper) {
|
||||
return new Handler(mainLooper);
|
||||
}
|
||||
|
||||
/** */
|
||||
@Provides
|
||||
public AmbientDisplayConfiguration provideAmbientDispalyConfiguration(Context context) {
|
||||
@@ -175,7 +142,7 @@ public class DependencyProvider {
|
||||
@Singleton
|
||||
@Provides
|
||||
public NightDisplayListener provideNightDisplayListener(Context context,
|
||||
@BgHandler Handler bgHandler) {
|
||||
@Background Handler bgHandler) {
|
||||
return new NightDisplayListener(context, bgHandler);
|
||||
}
|
||||
|
||||
@@ -188,7 +155,7 @@ public class DependencyProvider {
|
||||
@Singleton
|
||||
@Provides
|
||||
public NavigationBarController provideNavigationBarController(Context context,
|
||||
@MainHandler Handler mainHandler, CommandQueue commandQueue) {
|
||||
@Main Handler mainHandler, CommandQueue commandQueue) {
|
||||
return new NavigationBarController(context, mainHandler, commandQueue);
|
||||
}
|
||||
|
||||
@@ -201,7 +168,7 @@ public class DependencyProvider {
|
||||
@Singleton
|
||||
@Provides
|
||||
public AutoHideController provideAutoHideController(Context context,
|
||||
@MainHandler Handler mainHandler,
|
||||
@Main Handler mainHandler,
|
||||
NotificationRemoteInputManager notificationRemoteInputManager,
|
||||
IWindowManager iWindowManager) {
|
||||
return new AutoHideController(context, mainHandler, notificationRemoteInputManager,
|
||||
|
||||
@@ -44,8 +44,8 @@ import android.view.accessibility.AccessibilityManager;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.internal.util.LatencyTracker;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.shared.system.PackageManagerWrapper;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -126,7 +126,7 @@ public class SystemServicesModule {
|
||||
@Provides
|
||||
@Nullable
|
||||
static LocalBluetoothManager provideLocalBluetoothController(Context context,
|
||||
@BgHandler Handler bgHandler) {
|
||||
@Background Handler bgHandler) {
|
||||
return LocalBluetoothManager.create(context, bgHandler, UserHandle.ALL);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class SystemServicesModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
@MainResources
|
||||
@Main
|
||||
static Resources provideResources(Context context) {
|
||||
return context.getResources();
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.dagger.qualifiers;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface BgHandler {
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.dagger.qualifiers;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface BgLooper {
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.dagger.qualifiers;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface MainHandler {
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.dagger.qualifiers;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface MainLooper {
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.dagger.qualifiers;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
public @interface MainResources {
|
||||
// TODO: use attribute to get other, non-main resources?
|
||||
}
|
||||
@@ -32,8 +32,8 @@ import android.widget.TextView;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.keyguard.CarrierTextController;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.statusbar.policy.NetworkController;
|
||||
|
||||
@@ -111,7 +111,7 @@ public class QSCarrierGroupController {
|
||||
}
|
||||
|
||||
private QSCarrierGroupController(QSCarrierGroup view, ActivityStarter activityStarter,
|
||||
@BgHandler Handler bgHandler, @MainLooper Looper mainLooper,
|
||||
@Background Handler bgHandler, @Main Looper mainLooper,
|
||||
NetworkController networkController,
|
||||
CarrierTextController.Builder carrierTextControllerBuilder) {
|
||||
mActivityStarter = activityStarter;
|
||||
@@ -308,8 +308,8 @@ public class QSCarrierGroupController {
|
||||
private final CarrierTextController.Builder mCarrierTextControllerBuilder;
|
||||
|
||||
@Inject
|
||||
public Builder(ActivityStarter activityStarter, @BgHandler Handler handler,
|
||||
@MainLooper Looper looper, NetworkController networkController,
|
||||
public Builder(ActivityStarter activityStarter, @Background Handler handler,
|
||||
@Main Looper looper, NetworkController networkController,
|
||||
CarrierTextController.Builder carrierTextControllerBuilder) {
|
||||
mActivityStarter = activityStarter;
|
||||
mHandler = handler;
|
||||
|
||||
@@ -34,8 +34,8 @@ import com.android.systemui.DumpController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.qs.QSFactory;
|
||||
import com.android.systemui.plugins.qs.QSTile;
|
||||
@@ -96,8 +96,8 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D
|
||||
public QSTileHost(Context context,
|
||||
StatusBarIconController iconController,
|
||||
QSFactoryImpl defaultFactory,
|
||||
@MainHandler Handler mainHandler,
|
||||
@BgLooper Looper bgLooper,
|
||||
@Main Handler mainHandler,
|
||||
@Background Looper bgLooper,
|
||||
PluginManager pluginManager,
|
||||
TunerService tunerService,
|
||||
Provider<AutoTileManager> autoTiles,
|
||||
|
||||
@@ -68,7 +68,7 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
|
||||
@@ -186,7 +186,7 @@ public class GlobalScreenshot {
|
||||
*/
|
||||
@Inject
|
||||
public GlobalScreenshot(
|
||||
Context context, @MainResources Resources resources, LayoutInflater layoutInflater,
|
||||
Context context, @Main Resources resources, LayoutInflater layoutInflater,
|
||||
ScreenshotNotificationsController screenshotNotificationsController) {
|
||||
mContext = context;
|
||||
mNotificationsController = screenshotNotificationsController;
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.statusbar.RegisterStatusBarResult;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.assist.AssistHandleViewController;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.fragments.FragmentHostManager;
|
||||
import com.android.systemui.plugins.DarkIconDispatcher;
|
||||
import com.android.systemui.statusbar.CommandQueue.Callbacks;
|
||||
@@ -65,7 +65,7 @@ public class NavigationBarController implements Callbacks {
|
||||
SparseArray<NavigationBarFragment> mNavigationBars = new SparseArray<>();
|
||||
|
||||
@Inject
|
||||
public NavigationBarController(Context context, @MainHandler Handler handler,
|
||||
public NavigationBarController(Context context, @Main Handler handler,
|
||||
CommandQueue commandQueue) {
|
||||
mContext = context;
|
||||
mHandler = handler;
|
||||
|
||||
@@ -30,7 +30,7 @@ import android.os.UserHandle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -58,7 +58,7 @@ public class NotificationListener extends NotificationListenerWithPlugins {
|
||||
public NotificationListener(
|
||||
Context context,
|
||||
NotificationManager notificationManager,
|
||||
@MainHandler Handler mainHandler) {
|
||||
@Main Handler mainHandler) {
|
||||
mContext = context;
|
||||
mNotificationManager = notificationManager;
|
||||
mMainHandler = mainHandler;
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
@@ -190,7 +190,7 @@ public class NotificationLockscreenUserManagerImpl implements
|
||||
IStatusBarService iStatusBarService,
|
||||
KeyguardManager keyguardManager,
|
||||
StatusBarStateController statusBarStateController,
|
||||
@MainHandler Handler mainHandler,
|
||||
@Main Handler mainHandler,
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
KeyguardStateController keyguardStateController) {
|
||||
mContext = context;
|
||||
|
||||
@@ -50,7 +50,7 @@ import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.internal.statusbar.NotificationVisibility;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
@@ -263,7 +263,7 @@ public class NotificationRemoteInputManager implements Dumpable {
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
Lazy<StatusBar> statusBarLazy,
|
||||
StatusBarStateController statusBarStateController,
|
||||
@MainHandler Handler mainHandler,
|
||||
@Main Handler mainHandler,
|
||||
RemoteInputUriController remoteInputUriController) {
|
||||
mContext = context;
|
||||
mLockscreenUserManager = lockscreenUserManager;
|
||||
|
||||
@@ -27,7 +27,7 @@ import android.view.ViewGroup;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
@@ -93,7 +93,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
||||
private boolean mIsHandleDynamicPrivacyChangeScheduled;
|
||||
|
||||
@Inject
|
||||
public NotificationViewHierarchyManager(Context context, @MainHandler Handler mainHandler,
|
||||
public NotificationViewHierarchyManager(Context context, @Main Handler mainHandler,
|
||||
NotificationLockscreenUserManager notificationLockscreenUserManager,
|
||||
NotificationGroupManager groupManager,
|
||||
VisualStabilityManager visualStabilityManager,
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.view.View;
|
||||
import androidx.collection.ArraySet;
|
||||
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.NotificationPresenter;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||
@@ -62,7 +62,7 @@ public class VisualStabilityManager implements OnHeadsUpChangedListener, Dumpabl
|
||||
|
||||
@Inject
|
||||
public VisualStabilityManager(
|
||||
NotificationEntryManager notificationEntryManager, @MainHandler Handler handler) {
|
||||
NotificationEntryManager notificationEntryManager, @Main Handler handler) {
|
||||
|
||||
mHandler = handler;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.util.ArraySet;
|
||||
|
||||
import com.android.systemui.ForegroundServiceController;
|
||||
import com.android.systemui.appops.AppOpsController;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollectionListener;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifLifetimeExtender;
|
||||
@@ -63,7 +63,7 @@ public class ForegroundCoordinator implements Coordinator {
|
||||
public ForegroundCoordinator(
|
||||
ForegroundServiceController foregroundServiceController,
|
||||
AppOpsController appOpsController,
|
||||
@MainHandler Handler mainHandler) {
|
||||
@Main Handler mainHandler) {
|
||||
mForegroundServiceController = foregroundServiceController;
|
||||
mAppOpsController = appOpsController;
|
||||
mMainHandler = mainHandler;
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.os.Handler
|
||||
import android.os.UserHandle
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler
|
||||
import com.android.systemui.dagger.qualifiers.Main
|
||||
import com.android.systemui.plugins.ActivityStarter
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationSectionsManager
|
||||
import javax.inject.Inject
|
||||
@@ -164,7 +164,7 @@ private class PeopleHubViewModelFactoryImpl(
|
||||
|
||||
@Singleton
|
||||
class PeopleHubSettingChangeDataSourceImpl @Inject constructor(
|
||||
@MainHandler private val handler: Handler,
|
||||
@Main private val handler: Handler,
|
||||
context: Context
|
||||
) : DataSource<Boolean> {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.NotificationLifetimeExtender;
|
||||
@@ -108,7 +108,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
|
||||
@Inject
|
||||
public NotificationGutsManager(Context context, VisualStabilityManager visualStabilityManager,
|
||||
Lazy<StatusBar> statusBarLazy, @MainHandler Handler mainHandler,
|
||||
Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler,
|
||||
AccessibilityManager accessibilityManager) {
|
||||
mContext = context;
|
||||
mVisualStabilityManager = visualStabilityManager;
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.util.Log;
|
||||
import android.view.IWindowManager;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -52,7 +52,7 @@ public class AutoHideController {
|
||||
};
|
||||
|
||||
@Inject
|
||||
public AutoHideController(Context context, @MainHandler Handler handler,
|
||||
public AutoHideController(Context context, @Main Handler handler,
|
||||
NotificationRemoteInputManager notificationRemoteInputManager,
|
||||
IWindowManager iWindowManager) {
|
||||
mHandler = handler;
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.os.Handler;
|
||||
import android.provider.Settings.Secure;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.qs.AutoAddTracker;
|
||||
import com.android.systemui.qs.QSTileHost;
|
||||
import com.android.systemui.qs.SecureSetting;
|
||||
@@ -57,7 +57,7 @@ public class AutoTileManager {
|
||||
|
||||
@Inject
|
||||
public AutoTileManager(Context context, AutoAddTracker autoAddTracker, QSTileHost host,
|
||||
@BgHandler Handler handler,
|
||||
@Background Handler handler,
|
||||
HotspotController hotspotController,
|
||||
DataSaverController dataSaverController,
|
||||
ManagedProfileController managedProfileController,
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.DumpController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||
@@ -165,7 +165,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
StatusBarWindowController statusBarWindowController,
|
||||
KeyguardStateController keyguardStateController, Handler handler,
|
||||
KeyguardUpdateMonitor keyguardUpdateMonitor,
|
||||
@MainResources Resources resources,
|
||||
@Main Resources resources,
|
||||
KeyguardBypassController keyguardBypassController, DozeParameters dozeParameters,
|
||||
MetricsLogger metricsLogger, DumpController dumpController) {
|
||||
mContext = context;
|
||||
|
||||
@@ -25,7 +25,7 @@ import android.provider.Settings;
|
||||
import android.util.MathUtils;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.doze.AlwaysOnDisplayPolicy;
|
||||
import com.android.systemui.doze.DozeScreenState;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
@@ -58,7 +58,7 @@ public class DozeParameters implements TunerService.Tunable,
|
||||
|
||||
@Inject
|
||||
protected DozeParameters(
|
||||
@MainResources Resources resources,
|
||||
@Main Resources resources,
|
||||
AmbientDisplayConfiguration ambientDisplayConfiguration,
|
||||
AlwaysOnDisplayPolicy alwaysOnDisplayPolicy,
|
||||
PowerManager powerManager,
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.android.internal.util.IndentingPrintWriter;
|
||||
import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.systemui.DumpController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
@@ -83,7 +83,7 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen
|
||||
KeyguardUpdateMonitor keyguardUpdateMonitor,
|
||||
DumpController dumpController,
|
||||
NotificationMediaManager mediaManager,
|
||||
@MainHandler Handler mainHandler) {
|
||||
@Main Handler mainHandler) {
|
||||
dumpController.registerDumpable(getClass().getSimpleName(), this);
|
||||
mWallpaperManager = wallpaperManager;
|
||||
mCurrentUserId = ActivityManager.getCurrentUser();
|
||||
|
||||
@@ -93,7 +93,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.assist.AssistHandleViewController;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.fragments.FragmentHostManager;
|
||||
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
@@ -274,7 +274,7 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
|
||||
CommandQueue commandQueue, Divider divider,
|
||||
Optional<Recents> recentsOptional, Lazy<StatusBar> statusBarLazy,
|
||||
ShadeController shadeController,
|
||||
@MainHandler Handler mainHandler) {
|
||||
@Main Handler mainHandler) {
|
||||
mAccessibilityManagerWrapper = accessibilityManagerWrapper;
|
||||
mDeviceProvisionedController = deviceProvisionedController;
|
||||
mStatusBarStateController = statusBarStateController;
|
||||
|
||||
@@ -45,7 +45,7 @@ import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.dock.DockManager;
|
||||
import com.android.systemui.statusbar.ScrimView;
|
||||
import com.android.systemui.statusbar.notification.stack.ViewState;
|
||||
@@ -192,7 +192,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
@Inject
|
||||
public ScrimController(LightBarController lightBarController, DozeParameters dozeParameters,
|
||||
AlarmManager alarmManager, KeyguardStateController keyguardStateController,
|
||||
@MainResources Resources resources,
|
||||
@Main Resources resources,
|
||||
DelayedWakeLock.Builder delayedWakeLockBuilder, Handler handler,
|
||||
KeyguardUpdateMonitor keyguardUpdateMonitor, SysuiColorExtractor sysuiColorExtractor,
|
||||
DockManager dockManager) {
|
||||
|
||||
@@ -52,8 +52,8 @@ import com.android.systemui.EventLogTags;
|
||||
import com.android.systemui.UiOffloadThread;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
@@ -549,8 +549,8 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
NotificationInterruptionStateProvider notificationInterruptionStateProvider,
|
||||
MetricsLogger metricsLogger,
|
||||
LockPatternUtils lockPatternUtils,
|
||||
@MainHandler Handler mainThreadHandler,
|
||||
@BgHandler Handler backgroundHandler,
|
||||
@Main Handler mainThreadHandler,
|
||||
@Background Handler backgroundHandler,
|
||||
ActivityIntentHelper activityIntentHelper,
|
||||
BubbleController bubbleController,
|
||||
ShadeController shadeController,
|
||||
|
||||
@@ -41,7 +41,7 @@ import android.view.WindowManager.LayoutParams;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
@@ -105,7 +105,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
|
||||
ConfigurationController configurationController,
|
||||
KeyguardBypassController keyguardBypassController, SysuiColorExtractor colorExtractor,
|
||||
SuperStatusBarViewFactory superStatusBarViewFactory,
|
||||
@MainResources Resources resources) {
|
||||
@Main Resources resources) {
|
||||
mContext = context;
|
||||
mWindowManager = windowManager;
|
||||
mActivityManager = activityManager;
|
||||
|
||||
@@ -34,8 +34,8 @@ import com.android.settingslib.fuelgauge.BatterySaverUtils;
|
||||
import com.android.settingslib.fuelgauge.Estimate;
|
||||
import com.android.settingslib.utils.PowerUtil;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.power.EnhancedEstimates;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -82,7 +82,7 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC
|
||||
@Inject
|
||||
BatteryControllerImpl(Context context, EnhancedEstimates enhancedEstimates,
|
||||
PowerManager powerManager, BroadcastDispatcher broadcastDispatcher,
|
||||
@MainHandler Handler mainHandler, @BgHandler Handler bgHandler) {
|
||||
@Main Handler mainHandler, @Background Handler bgHandler) {
|
||||
mContext = context;
|
||||
mMainHandler = mainHandler;
|
||||
mBgHandler = bgHandler;
|
||||
|
||||
@@ -34,8 +34,8 @@ import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
@@ -75,8 +75,8 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
public BluetoothControllerImpl(Context context, @BgLooper Looper bgLooper,
|
||||
@MainLooper Looper mainLooper, @Nullable LocalBluetoothManager localBluetoothManager) {
|
||||
public BluetoothControllerImpl(Context context, @Background Looper bgLooper,
|
||||
@Main Looper mainLooper, @Nullable LocalBluetoothManager localBluetoothManager) {
|
||||
mLocalBluetoothManager = localBluetoothManager;
|
||||
mBgHandler = new Handler(bgLooper);
|
||||
mHandler = new H(mainLooper);
|
||||
|
||||
@@ -25,7 +25,7 @@ import android.provider.Settings.Secure;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.settings.CurrentUserTracker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -50,7 +50,7 @@ public class DeviceProvisionedControllerImpl extends CurrentUserTracker implemen
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
public DeviceProvisionedControllerImpl(Context context, @MainHandler Handler mainHandler,
|
||||
public DeviceProvisionedControllerImpl(Context context, @Main Handler mainHandler,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
super(broadcastDispatcher);
|
||||
mContext = context;
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.os.HandlerExecutor;
|
||||
import android.os.UserManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
@@ -59,7 +59,7 @@ public class HotspotControllerImpl implements HotspotController, WifiManager.Sof
|
||||
* Controller used to retrieve information related to a hotspot.
|
||||
*/
|
||||
@Inject
|
||||
public HotspotControllerImpl(Context context, @MainHandler Handler mainHandler) {
|
||||
public HotspotControllerImpl(Context context, @Main Handler mainHandler) {
|
||||
mContext = context;
|
||||
mConnectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
@@ -37,7 +37,7 @@ import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.systemui.BootCompleteCache;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.util.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -69,7 +69,7 @@ public class LocationControllerImpl extends BroadcastReceiver implements Locatio
|
||||
private final H mHandler = new H();
|
||||
|
||||
@Inject
|
||||
public LocationControllerImpl(Context context, @BgLooper Looper bgLooper,
|
||||
public LocationControllerImpl(Context context, @Background Looper bgLooper,
|
||||
BroadcastDispatcher broadcastDispatcher, BootCompleteCache bootCompleteCache) {
|
||||
mContext = context;
|
||||
mBroadcastDispatcher = broadcastDispatcher;
|
||||
|
||||
@@ -64,7 +64,7 @@ import com.android.systemui.DemoMode;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.settings.CurrentUserTracker;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener;
|
||||
import com.android.systemui.statusbar.policy.MobileSignalController.MobileIconGroup;
|
||||
@@ -177,7 +177,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
|
||||
* Construct this controller object and register for updates.
|
||||
*/
|
||||
@Inject
|
||||
public NetworkControllerImpl(Context context, @BgLooper Looper bgLooper,
|
||||
public NetworkControllerImpl(Context context, @Background Looper bgLooper,
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
this(context, (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE),
|
||||
|
||||
@@ -49,7 +49,7 @@ import com.android.internal.net.LegacyVpnInfo;
|
||||
import com.android.internal.net.VpnConfig;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.settings.CurrentUserTracker;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -101,7 +101,7 @@ public class SecurityControllerImpl extends CurrentUserTracker implements Securi
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
public SecurityControllerImpl(Context context, @BgHandler Handler bgHandler,
|
||||
public SecurityControllerImpl(Context context, @Background Handler bgHandler,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
this(context, bgHandler, broadcastDispatcher, null);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import android.util.Log;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@@ -65,7 +65,7 @@ public final class SmartReplyConstants {
|
||||
private final KeyValueListParser mParser = new KeyValueListParser(',');
|
||||
|
||||
@Inject
|
||||
public SmartReplyConstants(@MainHandler Handler handler, Context context) {
|
||||
public SmartReplyConstants(@Main Handler handler, Context context) {
|
||||
mHandler = handler;
|
||||
mContext = context;
|
||||
final Resources resources = mContext.getResources();
|
||||
|
||||
@@ -60,7 +60,7 @@ import com.android.systemui.Prefs.Key;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SystemUISecondaryUserService;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
import com.android.systemui.qs.tiles.UserDetailView;
|
||||
@@ -113,7 +113,7 @@ public class UserSwitcherController implements Dumpable {
|
||||
|
||||
@Inject
|
||||
public UserSwitcherController(Context context, KeyguardStateController keyguardStateController,
|
||||
@MainHandler Handler handler, ActivityStarter activityStarter,
|
||||
@Main Handler handler, ActivityStarter activityStarter,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
mContext = context;
|
||||
mBroadcastDispatcher = broadcastDispatcher;
|
||||
|
||||
@@ -40,7 +40,7 @@ import android.util.Log;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.qs.GlobalSetting;
|
||||
import com.android.systemui.settings.CurrentUserTracker;
|
||||
import com.android.systemui.util.Utils;
|
||||
@@ -78,7 +78,7 @@ public class ZenModeControllerImpl extends CurrentUserTracker
|
||||
private NotificationManager.Policy mConsolidatedNotificationPolicy;
|
||||
|
||||
@Inject
|
||||
public ZenModeControllerImpl(Context context, @MainHandler Handler handler,
|
||||
public ZenModeControllerImpl(Context context, @Main Handler handler,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
super(broadcastDispatcher);
|
||||
mContext = context;
|
||||
|
||||
@@ -36,7 +36,7 @@ import android.util.Log;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.BgHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
|
||||
import com.google.android.collect.Sets;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ThemeOverlayController extends SystemUI {
|
||||
|
||||
@Inject
|
||||
public ThemeOverlayController(Context context, BroadcastDispatcher broadcastDispatcher,
|
||||
@BgHandler Handler bgHandler) {
|
||||
@Background Handler bgHandler) {
|
||||
super(context);
|
||||
mBroadcastDispatcher = broadcastDispatcher;
|
||||
mBgHandler = bgHandler;
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.DemoMode;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.qs.QSTileHost;
|
||||
import com.android.systemui.settings.CurrentUserTracker;
|
||||
import com.android.systemui.statusbar.phone.StatusBarIconController;
|
||||
@@ -82,7 +82,7 @@ public class TunerServiceImpl extends TunerService {
|
||||
/**
|
||||
*/
|
||||
@Inject
|
||||
public TunerServiceImpl(Context context, @MainHandler Handler mainHandler,
|
||||
public TunerServiceImpl(Context context, @Main Handler mainHandler,
|
||||
LeakDetector leakDetector, BroadcastDispatcher broadcastDispatcher) {
|
||||
mContext = context;
|
||||
mContentResolver = mContext.getContentResolver();
|
||||
|
||||
@@ -18,15 +18,17 @@ package com.android.systemui.util.concurrency;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.dagger.qualifiers.MainLooper;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -35,11 +37,51 @@ import dagger.Provides;
|
||||
*/
|
||||
@Module
|
||||
public abstract class ConcurrencyModule {
|
||||
/** Background Looper */
|
||||
@Provides
|
||||
@Singleton
|
||||
@Background
|
||||
public static Looper provideBgLooper() {
|
||||
HandlerThread thread = new HandlerThread("SysUiBg",
|
||||
Process.THREAD_PRIORITY_BACKGROUND);
|
||||
thread.start();
|
||||
return thread.getLooper();
|
||||
}
|
||||
|
||||
/** Main Looper */
|
||||
@Provides
|
||||
@Main
|
||||
public static Looper provideMainLooper() {
|
||||
return Looper.getMainLooper();
|
||||
}
|
||||
|
||||
/**
|
||||
* Background Handler.
|
||||
*
|
||||
* Prefer the Background Executor when possible.
|
||||
*/
|
||||
@Provides
|
||||
@Background
|
||||
public static Handler provideBgHandler(@Background Looper bgLooper) {
|
||||
return new Handler(bgLooper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Handler.
|
||||
*
|
||||
* Prefer the Main Executor when possible.
|
||||
*/
|
||||
@Provides
|
||||
@Main
|
||||
public static Handler provideMainHandler(@Main Looper mainLooper) {
|
||||
return new Handler(mainLooper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a Background-Thread Executor by default.
|
||||
*/
|
||||
@Provides
|
||||
public static Executor provideExecutor(@BgLooper Looper looper) {
|
||||
public static Executor provideExecutor(@Background Looper looper) {
|
||||
return new ExecutorImpl(new Handler(looper));
|
||||
}
|
||||
|
||||
@@ -48,7 +90,7 @@ public abstract class ConcurrencyModule {
|
||||
*/
|
||||
@Provides
|
||||
@Background
|
||||
public static Executor provideBackgroundExecutor(@BgLooper Looper looper) {
|
||||
public static Executor provideBackgroundExecutor(@Background Looper looper) {
|
||||
return new ExecutorImpl(new Handler(looper));
|
||||
}
|
||||
|
||||
@@ -65,7 +107,7 @@ public abstract class ConcurrencyModule {
|
||||
* Provide a Background-Thread Executor by default.
|
||||
*/
|
||||
@Provides
|
||||
public static DelayableExecutor provideDelayableExecutor(@BgLooper Looper looper) {
|
||||
public static DelayableExecutor provideDelayableExecutor(@Background Looper looper) {
|
||||
return new ExecutorImpl(new Handler(looper));
|
||||
}
|
||||
|
||||
@@ -74,7 +116,7 @@ public abstract class ConcurrencyModule {
|
||||
*/
|
||||
@Provides
|
||||
@Background
|
||||
public static DelayableExecutor provideBackgroundDelayableExecutor(@BgLooper Looper looper) {
|
||||
public static DelayableExecutor provideBackgroundDelayableExecutor(@Background Looper looper) {
|
||||
return new ExecutorImpl(new Handler(looper));
|
||||
}
|
||||
|
||||
@@ -83,7 +125,7 @@ public abstract class ConcurrencyModule {
|
||||
*/
|
||||
@Provides
|
||||
@Main
|
||||
public static DelayableExecutor provideMainDelayableExecutor(@MainLooper Looper looper) {
|
||||
public static DelayableExecutor provideMainDelayableExecutor(@Main Looper looper) {
|
||||
return new ExecutorImpl(new Handler(looper));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import android.util.LongSparseArray;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.dagger.qualifiers.BgLooper;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.qs.QSTile;
|
||||
import com.android.systemui.qs.QSHost;
|
||||
@@ -109,7 +109,7 @@ public class GarbageMonitor implements Dumpable {
|
||||
@Inject
|
||||
public GarbageMonitor(
|
||||
Context context,
|
||||
@BgLooper Looper bgLooper,
|
||||
@Background Looper bgLooper,
|
||||
LeakDetector leakDetector,
|
||||
LeakReporter leakReporter) {
|
||||
mContext = context.getApplicationContext();
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.dagger.qualifiers.MainResources;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -65,7 +65,7 @@ public class ProximitySensor {
|
||||
};
|
||||
|
||||
@Inject
|
||||
public ProximitySensor(@MainResources Resources resources,
|
||||
public ProximitySensor(@Main Resources resources,
|
||||
AsyncSensorManager sensorManager) {
|
||||
mSensorManager = sensorManager;
|
||||
Sensor sensor = findBrightnessSensor(resources);
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.view.IDisplayWindowRotationController;
|
||||
import android.view.IWindowManager;
|
||||
import android.view.WindowContainerTransaction;
|
||||
|
||||
import com.android.systemui.dagger.qualifiers.MainHandler;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -160,7 +160,7 @@ public class DisplayWindowController {
|
||||
};
|
||||
|
||||
@Inject
|
||||
public DisplayWindowController(Context context, @MainHandler Handler mainHandler,
|
||||
public DisplayWindowController(Context context, @Main Handler mainHandler,
|
||||
IWindowManager wmService) {
|
||||
mHandler = mainHandler;
|
||||
mContext = context;
|
||||
|
||||
Reference in New Issue
Block a user