Merge "Make Recents purely optional" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
809db6c873
@@ -66,7 +66,6 @@ import com.android.systemui.power.PowerUI;
|
|||||||
import com.android.systemui.privacy.PrivacyItemController;
|
import com.android.systemui.privacy.PrivacyItemController;
|
||||||
import com.android.systemui.qs.ReduceBrightColorsController;
|
import com.android.systemui.qs.ReduceBrightColorsController;
|
||||||
import com.android.systemui.recents.OverviewProxyService;
|
import com.android.systemui.recents.OverviewProxyService;
|
||||||
import com.android.systemui.recents.Recents;
|
|
||||||
import com.android.systemui.screenrecord.RecordingController;
|
import com.android.systemui.screenrecord.RecordingController;
|
||||||
import com.android.systemui.shared.plugins.PluginManager;
|
import com.android.systemui.shared.plugins.PluginManager;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
@@ -361,7 +360,6 @@ public class Dependency {
|
|||||||
@Inject Lazy<DozeParameters> mDozeParameters;
|
@Inject Lazy<DozeParameters> mDozeParameters;
|
||||||
@Inject Lazy<IWallpaperManager> mWallpaperManager;
|
@Inject Lazy<IWallpaperManager> mWallpaperManager;
|
||||||
@Inject Lazy<CommandQueue> mCommandQueue;
|
@Inject Lazy<CommandQueue> mCommandQueue;
|
||||||
@Inject Lazy<Recents> mRecents;
|
|
||||||
@Inject Lazy<RecordingController> mRecordingController;
|
@Inject Lazy<RecordingController> mRecordingController;
|
||||||
@Inject Lazy<ProtoTracer> mProtoTracer;
|
@Inject Lazy<ProtoTracer> mProtoTracer;
|
||||||
@Inject Lazy<MediaOutputDialogFactory> mMediaOutputDialogFactory;
|
@Inject Lazy<MediaOutputDialogFactory> mMediaOutputDialogFactory;
|
||||||
@@ -564,7 +562,6 @@ public class Dependency {
|
|||||||
mProviders.put(DozeParameters.class, mDozeParameters::get);
|
mProviders.put(DozeParameters.class, mDozeParameters::get);
|
||||||
mProviders.put(IWallpaperManager.class, mWallpaperManager::get);
|
mProviders.put(IWallpaperManager.class, mWallpaperManager::get);
|
||||||
mProviders.put(CommandQueue.class, mCommandQueue::get);
|
mProviders.put(CommandQueue.class, mCommandQueue::get);
|
||||||
mProviders.put(Recents.class, mRecents::get);
|
|
||||||
mProviders.put(ProtoTracer.class, mProtoTracer::get);
|
mProviders.put(ProtoTracer.class, mProtoTracer::get);
|
||||||
mProviders.put(DeviceConfigProxy.class, mDeviceConfigProxy::get);
|
mProviders.put(DeviceConfigProxy.class, mDeviceConfigProxy::get);
|
||||||
mProviders.put(TelephonyListenerManager.class, mTelephonyListenerManager::get);
|
mProviders.put(TelephonyListenerManager.class, mTelephonyListenerManager::get);
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class SystemActions extends SystemUI {
|
|||||||
private static final String PERMISSION_SELF = "com.android.systemui.permission.SELF";
|
private static final String PERMISSION_SELF = "com.android.systemui.permission.SELF";
|
||||||
|
|
||||||
private final SystemActionsBroadcastReceiver mReceiver;
|
private final SystemActionsBroadcastReceiver mReceiver;
|
||||||
private final Recents mRecents;
|
private final Optional<Recents> mRecentsOptional;
|
||||||
private Locale mLocale;
|
private Locale mLocale;
|
||||||
private final AccessibilityManager mA11yManager;
|
private final AccessibilityManager mA11yManager;
|
||||||
private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy;
|
private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy;
|
||||||
@@ -152,9 +152,9 @@ public class SystemActions extends SystemUI {
|
|||||||
public SystemActions(Context context,
|
public SystemActions(Context context,
|
||||||
NotificationShadeWindowController notificationShadeController,
|
NotificationShadeWindowController notificationShadeController,
|
||||||
Lazy<Optional<StatusBar>> statusBarOptionalLazy,
|
Lazy<Optional<StatusBar>> statusBarOptionalLazy,
|
||||||
Recents recents) {
|
Optional<Recents> recentsOptional) {
|
||||||
super(context);
|
super(context);
|
||||||
mRecents = recents;
|
mRecentsOptional = recentsOptional;
|
||||||
mReceiver = new SystemActionsBroadcastReceiver();
|
mReceiver = new SystemActionsBroadcastReceiver();
|
||||||
mLocale = mContext.getResources().getConfiguration().getLocales().get(0);
|
mLocale = mContext.getResources().getConfiguration().getLocales().get(0);
|
||||||
mA11yManager = (AccessibilityManager) mContext.getSystemService(
|
mA11yManager = (AccessibilityManager) mContext.getSystemService(
|
||||||
@@ -370,7 +370,7 @@ public class SystemActions extends SystemUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleRecents() {
|
private void handleRecents() {
|
||||||
mRecents.toggleRecentApps();
|
mRecentsOptional.ifPresent(Recents::toggleRecentApps);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleNotifications() {
|
private void handleNotifications() {
|
||||||
|
|||||||
@@ -611,6 +611,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
|
|||||||
@Override
|
@Override
|
||||||
public void onViewAttachedToWindow(View v) {
|
public void onViewAttachedToWindow(View v) {
|
||||||
final Display display = v.getDisplay();
|
final Display display = v.getDisplay();
|
||||||
|
mNavigationBarView.setComponents(mRecentsOptional);
|
||||||
mNavigationBarView.setComponents(mStatusBarOptionalLazy.get().get().getPanelController());
|
mNavigationBarView.setComponents(mStatusBarOptionalLazy.get().get().getPanelController());
|
||||||
mNavigationBarView.setDisabledFlags(mDisabledFlags1);
|
mNavigationBarView.setDisabledFlags(mDisabledFlags1);
|
||||||
mNavigationBarView.setOnVerticalChangedListener(this::onVerticalChanged);
|
mNavigationBarView.setOnVerticalChangedListener(this::onVerticalChanged);
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ import com.android.wm.shell.pip.Pip;
|
|||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class NavigationBarView extends FrameLayout implements
|
public class NavigationBarView extends FrameLayout implements
|
||||||
@@ -166,6 +167,7 @@ public class NavigationBarView extends FrameLayout implements
|
|||||||
|
|
||||||
private NavigationBarInflaterView mNavigationInflaterView;
|
private NavigationBarInflaterView mNavigationInflaterView;
|
||||||
private RecentsOnboarding mRecentsOnboarding;
|
private RecentsOnboarding mRecentsOnboarding;
|
||||||
|
private Optional<Recents> mRecentsOptional = Optional.empty();
|
||||||
private NotificationPanelViewController mPanelView;
|
private NotificationPanelViewController mPanelView;
|
||||||
private RotationContextButton mRotationContextButton;
|
private RotationContextButton mRotationContextButton;
|
||||||
private FloatingRotationButton mFloatingRotationButton;
|
private FloatingRotationButton mFloatingRotationButton;
|
||||||
@@ -254,7 +256,7 @@ public class NavigationBarView extends FrameLayout implements
|
|||||||
@Override
|
@Override
|
||||||
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
public boolean performAccessibilityAction(View host, int action, Bundle args) {
|
||||||
if (action == R.id.action_toggle_overview) {
|
if (action == R.id.action_toggle_overview) {
|
||||||
Dependency.get(Recents.class).toggleRecentApps();
|
mRecentsOptional.ifPresent(Recents::toggleRecentApps);
|
||||||
} else {
|
} else {
|
||||||
return super.performAccessibilityAction(host, action, args);
|
return super.performAccessibilityAction(host, action, args);
|
||||||
}
|
}
|
||||||
@@ -398,6 +400,10 @@ public class NavigationBarView extends FrameLayout implements
|
|||||||
return mBarTransitions.getLightTransitionsController();
|
return mBarTransitions.getLightTransitionsController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setComponents(Optional<Recents> recentsOptional) {
|
||||||
|
mRecentsOptional = recentsOptional;
|
||||||
|
}
|
||||||
|
|
||||||
public void setComponents(NotificationPanelViewController panel) {
|
public void setComponents(NotificationPanelViewController panel) {
|
||||||
mPanelView = panel;
|
mPanelView = panel;
|
||||||
updatePanelSystemUiStateFlags();
|
updatePanelSystemUiStateFlags();
|
||||||
|
|||||||
Reference in New Issue
Block a user