Merge "Final calls to getComponent(Recents.class) removed."
This commit is contained in:
@@ -46,10 +46,13 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||
import com.android.systemui.volume.CarVolumeDialogComponent;
|
||||
import com.android.systemui.volume.VolumeDialogComponent;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Lazy;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -76,8 +79,8 @@ abstract class CarSystemUIModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
static Divider provideDivider(Context context) {
|
||||
return new Divider(context);
|
||||
static Divider provideDivider(Context context, Optional<Lazy<Recents>> recentsOptionalLazy) {
|
||||
return new Divider(context, recentsOptionalLazy);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@@ -79,6 +79,7 @@ import com.android.systemui.navigationbar.car.CarNavigationBarView;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
import com.android.systemui.qs.car.CarQSFragment;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.recents.ScreenPinningRequest;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.stackdivider.Divider;
|
||||
@@ -300,6 +301,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
|
||||
DozeScrimController dozeScrimController,
|
||||
VolumeComponent volumeComponent,
|
||||
CommandQueue commandQueue,
|
||||
Optional<Recents> recents,
|
||||
PluginManager pluginManager,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
Optional<Divider> dividerOptional,
|
||||
@@ -372,6 +374,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
|
||||
dozeScrimController,
|
||||
volumeComponent,
|
||||
commandQueue,
|
||||
recents,
|
||||
pluginManager,
|
||||
remoteInputUriController,
|
||||
dividerOptional,
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||
import com.android.systemui.navigationbar.car.CarNavigationBarController;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.recents.ScreenPinningRequest;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.stackdivider.Divider;
|
||||
@@ -169,6 +170,7 @@ public class CarStatusBarModule {
|
||||
DozeScrimController dozeScrimController,
|
||||
VolumeComponent volumeComponent,
|
||||
CommandQueue commandQueue,
|
||||
Optional<Recents> recentsOptional,
|
||||
PluginManager pluginManager,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
Optional<Divider> dividerOptional,
|
||||
@@ -239,6 +241,7 @@ public class CarStatusBarModule {
|
||||
dozeScrimController,
|
||||
volumeComponent,
|
||||
commandQueue,
|
||||
recentsOptional,
|
||||
pluginManager,
|
||||
remoteInputUriController,
|
||||
dividerOptional,
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.android.systemui.power.EnhancedEstimates;
|
||||
import com.android.systemui.power.PowerUI;
|
||||
import com.android.systemui.privacy.PrivacyItemController;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.DevicePolicyManagerWrapper;
|
||||
@@ -329,6 +330,7 @@ public class Dependency {
|
||||
@Inject Lazy<DozeParameters> mDozeParameters;
|
||||
@Inject Lazy<IWallpaperManager> mWallpaperManager;
|
||||
@Inject Lazy<CommandQueue> mCommandQueue;
|
||||
@Inject Lazy<Recents> mRecents;
|
||||
@Inject Lazy<StatusBar> mStatusBar;
|
||||
|
||||
@Inject
|
||||
@@ -519,6 +521,7 @@ public class Dependency {
|
||||
mProviders.put(DozeParameters.class, mDozeParameters::get);
|
||||
mProviders.put(IWallpaperManager.class, mWallpaperManager::get);
|
||||
mProviders.put(CommandQueue.class, mCommandQueue::get);
|
||||
mProviders.put(Recents.class, mRecents::get);
|
||||
mProviders.put(StatusBar.class, mStatusBar::get);
|
||||
|
||||
// TODO(b/118592525): to support multi-display , we start to add something which is
|
||||
|
||||
@@ -38,10 +38,13 @@ import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
|
||||
import com.android.systemui.statusbar.phone.ShadeController;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Lazy;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -86,8 +89,8 @@ abstract class SystemUIDefaultModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
static Divider provideDivider(Context context) {
|
||||
return new Divider(context);
|
||||
static Divider provideDivider(Context context, Optional<Lazy<Recents>> recentsOptionalLazy) {
|
||||
return new Divider(context, recentsOptionalLazy);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -46,6 +46,7 @@ public class ShortcutKeyDispatcher extends SystemUI
|
||||
|
||||
private static final String TAG = "ShortcutKeyDispatcher";
|
||||
private final Divider mDivider;
|
||||
private final Recents mRecents;
|
||||
|
||||
private ShortcutKeyServiceProxy mShortcutKeyServiceProxy = new ShortcutKeyServiceProxy(this);
|
||||
private IWindowManager mWindowManagerService = WindowManagerGlobal.getWindowManagerService();
|
||||
@@ -59,9 +60,10 @@ public class ShortcutKeyDispatcher extends SystemUI
|
||||
protected final long SC_DOCK_RIGHT = META_MASK | KeyEvent.KEYCODE_RIGHT_BRACKET;
|
||||
|
||||
@Inject
|
||||
public ShortcutKeyDispatcher(Context context, Divider divider) {
|
||||
public ShortcutKeyDispatcher(Context context, Divider divider, Recents recents) {
|
||||
super(context);
|
||||
mDivider = divider;
|
||||
mRecents = recents;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,8 +98,7 @@ public class ShortcutKeyDispatcher extends SystemUI
|
||||
int dockSide = mWindowManagerService.getDockedStackSide();
|
||||
if (dockSide == WindowManager.DOCKED_INVALID) {
|
||||
// Split the screen
|
||||
Recents recents = getComponent(Recents.class);
|
||||
recents.splitPrimaryTask((shortcutCode == SC_DOCK_LEFT)
|
||||
mRecents.splitPrimaryTask((shortcutCode == SC_DOCK_LEFT)
|
||||
? SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT
|
||||
: SPLIT_SCREEN_CREATE_MODE_BOTTOM_OR_RIGHT, null, -1);
|
||||
} else {
|
||||
|
||||
@@ -34,12 +34,16 @@ import com.android.systemui.recents.Recents;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Optional;
|
||||
|
||||
import dagger.Lazy;
|
||||
|
||||
/**
|
||||
* Controls the docked stack divider.
|
||||
*/
|
||||
public class Divider extends SystemUI implements DividerView.DividerCallbacks {
|
||||
private static final String TAG = "Divider";
|
||||
private final Optional<Lazy<Recents>> mRecentsOptionalLazy;
|
||||
|
||||
private DividerWindowManager mWindowManager;
|
||||
private DividerView mView;
|
||||
@@ -51,8 +55,9 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks {
|
||||
private boolean mHomeStackResizable = false;
|
||||
private ForcedResizableInfoActivityController mForcedResizableController;
|
||||
|
||||
public Divider(Context context) {
|
||||
public Divider(Context context, Optional<Lazy<Recents>> recentsOptionalLazy) {
|
||||
super(context);
|
||||
mRecentsOptionalLazy = recentsOptionalLazy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,10 +221,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks {
|
||||
|
||||
@Override
|
||||
public void growRecents() {
|
||||
Recents recents = getComponent(Recents.class);
|
||||
if (recents != null) {
|
||||
recents.growRecents();
|
||||
}
|
||||
mRecentsOptionalLazy.ifPresent(recentsLazy -> recentsLazy.get().growRecents());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,7 +66,6 @@ import com.android.systemui.Dependency;
|
||||
import com.android.systemui.DockedStackExistsListener;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SysUiServiceProvider;
|
||||
import com.android.systemui.assist.AssistHandleViewController;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
@@ -214,31 +213,32 @@ public class NavigationBarView extends FrameLayout implements
|
||||
}
|
||||
};
|
||||
|
||||
private final AccessibilityDelegate mQuickStepAccessibilityDelegate
|
||||
= new AccessibilityDelegate() {
|
||||
private AccessibilityAction mToggleOverviewAction;
|
||||
private final AccessibilityDelegate mQuickStepAccessibilityDelegate =
|
||||
new AccessibilityDelegate() {
|
||||
private AccessibilityAction mToggleOverviewAction;
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||
if (mToggleOverviewAction == null) {
|
||||
mToggleOverviewAction = new AccessibilityAction(R.id.action_toggle_overview,
|
||||
getContext().getString(R.string.quick_step_accessibility_toggle_overview));
|
||||
}
|
||||
info.addAction(mToggleOverviewAction);
|
||||
}
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(View host,
|
||||
AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||
if (mToggleOverviewAction == null) {
|
||||
mToggleOverviewAction = new AccessibilityAction(
|
||||
R.id.action_toggle_overview, getContext().getString(
|
||||
R.string.quick_step_accessibility_toggle_overview));
|
||||
}
|
||||
info.addAction(mToggleOverviewAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
||||
if (action == R.id.action_toggle_overview) {
|
||||
SysUiServiceProvider.getComponent(getContext(), Recents.class)
|
||||
.toggleRecentApps();
|
||||
} else {
|
||||
return super.performAccessibilityAction(host, action, args);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
||||
if (action == R.id.action_toggle_overview) {
|
||||
Dependency.get(Recents.class).toggleRecentApps();
|
||||
} else {
|
||||
return super.performAccessibilityAction(host, action, args);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
private final OnComputeInternalInsetsListener mOnComputeInternalInsetsListener = info -> {
|
||||
// When the nav bar is in 2-button or 3-button mode, or when IME is visible in fully
|
||||
|
||||
@@ -674,6 +674,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
DozeScrimController dozeScrimController,
|
||||
VolumeComponent volumeComponent,
|
||||
CommandQueue commandQueue,
|
||||
Optional<Recents> recentsOptional,
|
||||
PluginManager pluginManager,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
Optional<Divider> dividerOptional,
|
||||
@@ -743,6 +744,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mBiometricUnlockControllerLazy = biometricUnlockControllerLazy;
|
||||
mVolumeComponent = volumeComponent;
|
||||
mCommandQueue = commandQueue;
|
||||
mRecentsOptional = recentsOptional;
|
||||
mPluginManager = pluginManager;
|
||||
mRemoteInputUriController = remoteInputUriController;
|
||||
mDividerOptional = dividerOptional;
|
||||
@@ -807,8 +809,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mBarService = IStatusBarService.Stub.asInterface(
|
||||
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
|
||||
|
||||
mRecents = getComponent(Recents.class);
|
||||
|
||||
mKeyguardManager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
|
||||
|
||||
// Connect in to the status bar manager service
|
||||
@@ -1432,7 +1432,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
}
|
||||
|
||||
protected boolean toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
|
||||
if (mRecents == null) {
|
||||
if (!mRecentsOptional.isPresent()) {
|
||||
return false;
|
||||
}
|
||||
int dockSide = WindowManagerProxy.getInstance().getDockSide();
|
||||
@@ -1444,7 +1444,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
int createMode = navbarPos == NAV_BAR_POS_LEFT
|
||||
? SPLIT_SCREEN_CREATE_MODE_BOTTOM_OR_RIGHT
|
||||
: SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
|
||||
return mRecents.splitPrimaryTask(createMode, null, metricsDockAction);
|
||||
return mRecentsOptional.get().splitPrimaryTask(createMode, null, metricsDockAction);
|
||||
} else {
|
||||
if (mDividerOptional.isPresent()) {
|
||||
Divider divider = mDividerOptional.get();
|
||||
@@ -4067,7 +4067,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
protected Display mDisplay;
|
||||
private int mDisplayId;
|
||||
|
||||
protected Recents mRecents;
|
||||
private final Optional<Recents> mRecentsOptional;
|
||||
|
||||
protected NotificationShelf mNotificationShelf;
|
||||
protected EmptyShadeView mEmptyShadeView;
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.recents.ScreenPinningRequest;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.stackdivider.Divider;
|
||||
@@ -154,6 +155,7 @@ public class StatusBarModule {
|
||||
DozeScrimController dozeScrimController,
|
||||
VolumeComponent volumeComponent,
|
||||
CommandQueue commandQueue,
|
||||
Optional<Recents> recentsOptional,
|
||||
PluginManager pluginManager,
|
||||
RemoteInputUriController remoteInputUriController,
|
||||
Optional<Divider> dividerOptional,
|
||||
@@ -224,6 +226,7 @@ public class StatusBarModule {
|
||||
dozeScrimController,
|
||||
volumeComponent,
|
||||
commandQueue,
|
||||
recentsOptional,
|
||||
pluginManager,
|
||||
remoteInputUriController,
|
||||
dividerOptional,
|
||||
|
||||
@@ -89,6 +89,7 @@ import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||
import com.android.systemui.plugins.ActivityStarter.OnDismissAction;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.recents.ScreenPinningRequest;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.stackdivider.Divider;
|
||||
@@ -222,7 +223,6 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
@Mock private NotificationIconAreaController mNotificationIconAreaController;
|
||||
@Mock private StatusBarWindowViewController.Builder mStatusBarWindowViewControllerBuilder;
|
||||
@Mock private StatusBarWindowViewController mStatusBarWindowViewController;
|
||||
@Mock private NotifLog mNotifLog;
|
||||
@Mock private DozeParameters mDozeParameters;
|
||||
@Mock private Lazy<LockscreenWallpaper> mLockscreenWallpaperLazy;
|
||||
@Mock private LockscreenWallpaper mLockscreenWallpaper;
|
||||
@@ -232,6 +232,7 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
@Mock private KeyguardLiftController mKeyguardLiftController;
|
||||
@Mock private VolumeComponent mVolumeComponent;
|
||||
@Mock private CommandQueue mCommandQueue;
|
||||
@Mock private Recents mRecents;
|
||||
@Mock private PluginManager mPluginManager;
|
||||
@Mock private Divider mDivider;
|
||||
@Mock private SuperStatusBarViewFactory mSuperStatusBarViewFactory;
|
||||
@@ -371,6 +372,7 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
mDozeScrimController,
|
||||
mVolumeComponent,
|
||||
mCommandQueue,
|
||||
Optional.of(mRecents),
|
||||
mPluginManager,
|
||||
mRemoteInputUriController,
|
||||
Optional.of(mDivider),
|
||||
|
||||
Reference in New Issue
Block a user