Added support for RootTaskDisplayAreaOrganizer
Allows shell to have information on the parent container for tasks so it can do things like attach other surfaces to it. E.g. split-screen divider. Also, have DisplayAreaOrganizer ctor take an executor so incoming calls from the binder threads can be posted to the main thread. Bug: 175416931 Test: They pass! Change-Id: Ia3d0b978cf43badd8c495b75708aa027fe9a2aa1
This commit is contained in:
@@ -2440,7 +2440,6 @@ package android.window {
|
||||
}
|
||||
|
||||
public class DisplayAreaOrganizer extends android.window.WindowOrganizer {
|
||||
ctor public DisplayAreaOrganizer();
|
||||
method public void onDisplayAreaAppeared(@NonNull android.window.DisplayAreaInfo, @NonNull android.view.SurfaceControl);
|
||||
method public void onDisplayAreaVanished(@NonNull android.window.DisplayAreaInfo);
|
||||
method @CallSuper @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public java.util.List<android.window.DisplayAreaAppearedInfo> registerOrganizer(int);
|
||||
|
||||
@@ -126,6 +126,10 @@ public class WindowlessWindowManager implements IWindowSession {
|
||||
}
|
||||
}
|
||||
|
||||
protected void attachToParentSurface(SurfaceControl.Builder b) {
|
||||
b.setParent(mRootSurface);
|
||||
}
|
||||
|
||||
/**
|
||||
* IWindowSession implementation.
|
||||
*/
|
||||
@@ -135,11 +139,11 @@ public class WindowlessWindowManager implements IWindowSession {
|
||||
DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel,
|
||||
InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) {
|
||||
final SurfaceControl.Builder b = new SurfaceControl.Builder(mSurfaceSession)
|
||||
.setParent(mRootSurface)
|
||||
.setFormat(attrs.format)
|
||||
.setBufferSize(getSurfaceWidth(attrs), getSurfaceHeight(attrs))
|
||||
.setName(attrs.getTitle().toString())
|
||||
.setCallsite("WindowlessWindowManager.addToDisplay");
|
||||
attachToParentSurface(b);
|
||||
final SurfaceControl sc = b.build();
|
||||
|
||||
if (((attrs.inputFeatures &
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.os.RemoteException;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Interface for WindowManager to delegate control of display areas.
|
||||
@@ -113,6 +114,24 @@ public class DisplayAreaOrganizer extends WindowOrganizer {
|
||||
*/
|
||||
public static final int FEATURE_RUNTIME_TASK_CONTAINER_FIRST = FEATURE_VENDOR_LAST + 1;
|
||||
|
||||
// Callbacks WM Core are posted on this executor if it isn't null, otherwise direct calls are
|
||||
// made on the incoming binder call.
|
||||
private final Executor mExecutor;
|
||||
|
||||
/** @hide */
|
||||
public DisplayAreaOrganizer(@NonNull Executor executor) {
|
||||
mExecutor = executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the executor to run callbacks on.
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
public Executor getExecutor() {
|
||||
return mExecutor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a DisplayAreaOrganizer to manage display areas for a given feature. A feature can
|
||||
* not be registered by multiple organizers at the same time.
|
||||
@@ -208,17 +227,20 @@ public class DisplayAreaOrganizer extends WindowOrganizer {
|
||||
@Override
|
||||
public void onDisplayAreaAppeared(@NonNull DisplayAreaInfo displayAreaInfo,
|
||||
@NonNull SurfaceControl leash) {
|
||||
DisplayAreaOrganizer.this.onDisplayAreaAppeared(displayAreaInfo, leash);
|
||||
mExecutor.execute(
|
||||
() -> DisplayAreaOrganizer.this.onDisplayAreaAppeared(displayAreaInfo, leash));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayAreaVanished(@NonNull DisplayAreaInfo displayAreaInfo) {
|
||||
DisplayAreaOrganizer.this.onDisplayAreaVanished(displayAreaInfo);
|
||||
mExecutor.execute(
|
||||
() -> DisplayAreaOrganizer.this.onDisplayAreaVanished(displayAreaInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayAreaInfoChanged(@NonNull DisplayAreaInfo displayAreaInfo) {
|
||||
DisplayAreaOrganizer.this.onDisplayAreaInfoChanged(displayAreaInfo);
|
||||
mExecutor.execute(
|
||||
() -> DisplayAreaOrganizer.this.onDisplayAreaInfoChanged(displayAreaInfo));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright (C) 2020 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.wm.shell;
|
||||
|
||||
import android.util.SparseArray;
|
||||
import android.view.SurfaceControl;
|
||||
import android.window.DisplayAreaInfo;
|
||||
import android.window.DisplayAreaOrganizer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/** Display area organizer for the root/default TaskDisplayAreas */
|
||||
public class RootTaskDisplayAreaOrganizer extends DisplayAreaOrganizer {
|
||||
|
||||
private static final String TAG = RootTaskDisplayAreaOrganizer.class.getSimpleName();
|
||||
|
||||
// Display area info. mapped by displayIds.
|
||||
private final SparseArray<DisplayAreaInfo> mDisplayAreasInfo = new SparseArray<>();
|
||||
// Display area leashes. mapped by displayIds.
|
||||
private final SparseArray<SurfaceControl> mLeashes = new SparseArray<>();
|
||||
|
||||
private final SparseArray<ArrayList<RootTaskDisplayAreaListener>> mListeners =
|
||||
new SparseArray<>();
|
||||
|
||||
public RootTaskDisplayAreaOrganizer(Executor executor) {
|
||||
super(executor);
|
||||
registerOrganizer(FEATURE_DEFAULT_TASK_CONTAINER);
|
||||
}
|
||||
|
||||
public void registerListener(int displayId, RootTaskDisplayAreaListener listener) {
|
||||
ArrayList<RootTaskDisplayAreaListener> listeners = mListeners.get(displayId);
|
||||
if (listeners == null) {
|
||||
listeners = new ArrayList<>();
|
||||
mListeners.put(displayId, listeners);
|
||||
}
|
||||
|
||||
listeners.add(listener);
|
||||
|
||||
final DisplayAreaInfo info = mDisplayAreasInfo.get(displayId);
|
||||
if (info != null) {
|
||||
listener.onDisplayAreaAppeared(info);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterListener(RootTaskDisplayAreaListener listener) {
|
||||
for (int i = mListeners.size() - 1; i >= 0; --i) {
|
||||
final List<RootTaskDisplayAreaListener> listeners = mListeners.valueAt(i);
|
||||
if (listeners == null) continue;
|
||||
listeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void attachToDisplayArea(int displayId, SurfaceControl.Builder b) {
|
||||
final SurfaceControl sc = mLeashes.get(displayId);
|
||||
b.setParent(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayAreaAppeared(@NonNull DisplayAreaInfo displayAreaInfo,
|
||||
@NonNull SurfaceControl leash) {
|
||||
if (displayAreaInfo.featureId != FEATURE_DEFAULT_TASK_CONTAINER) {
|
||||
throw new IllegalArgumentException(
|
||||
"Unknown feature: " + displayAreaInfo.featureId
|
||||
+ "displayAreaInfo:" + displayAreaInfo);
|
||||
}
|
||||
|
||||
final int displayId = displayAreaInfo.displayId;
|
||||
if (mDisplayAreasInfo.get(displayId) != null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Duplicate DA for displayId: " + displayId
|
||||
+ " displayAreaInfo:" + displayAreaInfo
|
||||
+ " mDisplayAreasInfo.get():" + mDisplayAreasInfo.get(displayId));
|
||||
}
|
||||
|
||||
mDisplayAreasInfo.put(displayId, displayAreaInfo);
|
||||
|
||||
ArrayList<RootTaskDisplayAreaListener> listeners = mListeners.get(displayId);
|
||||
if (listeners != null) {
|
||||
for (int i = listeners.size() - 1; i >= 0; --i) {
|
||||
listeners.get(i).onDisplayAreaAppeared(displayAreaInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayAreaVanished(@NonNull DisplayAreaInfo displayAreaInfo) {
|
||||
final int displayId = displayAreaInfo.displayId;
|
||||
if (mDisplayAreasInfo.get(displayId) == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"onDisplayAreaVanished() Unknown DA displayId: " + displayId
|
||||
+ " displayAreaInfo:" + displayAreaInfo
|
||||
+ " mDisplayAreasInfo.get():" + mDisplayAreasInfo.get(displayId));
|
||||
}
|
||||
|
||||
mDisplayAreasInfo.remove(displayId);
|
||||
|
||||
ArrayList<RootTaskDisplayAreaListener> listeners = mListeners.get(displayId);
|
||||
if (listeners != null) {
|
||||
for (int i = listeners.size() - 1; i >= 0; --i) {
|
||||
listeners.get(i).onDisplayAreaVanished(displayAreaInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayAreaInfoChanged(@NonNull DisplayAreaInfo displayAreaInfo) {
|
||||
final int displayId = displayAreaInfo.displayId;
|
||||
if (mDisplayAreasInfo.get(displayId) == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"onDisplayAreaInfoChanged() Unknown DA displayId: " + displayId
|
||||
+ " displayAreaInfo:" + displayAreaInfo
|
||||
+ " mDisplayAreasInfo.get():" + mDisplayAreasInfo.get(displayId));
|
||||
}
|
||||
|
||||
mDisplayAreasInfo.put(displayId, displayAreaInfo);
|
||||
|
||||
ArrayList<RootTaskDisplayAreaListener> listeners = mListeners.get(displayId);
|
||||
if (listeners != null) {
|
||||
for (int i = listeners.size() - 1; i >= 0; --i) {
|
||||
listeners.get(i).onDisplayAreaInfoChanged(displayAreaInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dump(@NonNull PrintWriter pw, String prefix) {
|
||||
final String innerPrefix = prefix + " ";
|
||||
final String childPrefix = innerPrefix + " ";
|
||||
pw.println(prefix + this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return TAG + "#" + mDisplayAreasInfo.size();
|
||||
}
|
||||
|
||||
/** Callbacks for when root task display areas change. */
|
||||
public interface RootTaskDisplayAreaListener {
|
||||
default void onDisplayAreaAppeared(DisplayAreaInfo displayAreaInfo) {
|
||||
}
|
||||
|
||||
default void onDisplayAreaVanished(DisplayAreaInfo displayAreaInfo) {
|
||||
}
|
||||
|
||||
default void onDisplayAreaInfoChanged(DisplayAreaInfo displayAreaInfo) {
|
||||
}
|
||||
|
||||
default void dump(@NonNull PrintWriter pw, String prefix) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.LayoutChan
|
||||
mTaskInfo2 = task2;
|
||||
mSplitLayout = new SplitLayout(
|
||||
mDisplayController.getDisplayContext(mRootTaskInfo.displayId),
|
||||
mRootTaskInfo.configuration, this, mRootTaskLeash);
|
||||
mRootTaskInfo.configuration, this, b -> b.setParent(mRootTaskLeash));
|
||||
|
||||
final WindowContainerToken token1 = task1.token;
|
||||
final WindowContainerToken token2 = task2.token;
|
||||
|
||||
@@ -57,10 +57,12 @@ public class SplitLayout {
|
||||
private int mDividePosition;
|
||||
|
||||
public SplitLayout(Context context, Configuration configuration,
|
||||
LayoutChangeListener layoutChangeListener, SurfaceControl rootLeash) {
|
||||
LayoutChangeListener layoutChangeListener,
|
||||
SplitWindowManager.ParentContainerCallbacks parentContainerCallbacks) {
|
||||
mContext = context.createConfigurationContext(configuration);
|
||||
mLayoutChangeListener = layoutChangeListener;
|
||||
mSplitWindowManager = new SplitWindowManager(mContext, configuration, rootLeash);
|
||||
mSplitWindowManager = new SplitWindowManager(
|
||||
mContext, configuration, parentContainerCallbacks);
|
||||
|
||||
mDividerWindowWidth = context.getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.docked_stack_divider_thickness);
|
||||
|
||||
@@ -51,10 +51,17 @@ public final class SplitWindowManager extends WindowlessWindowManager {
|
||||
|
||||
private Context mContext;
|
||||
private SurfaceControlViewHost mViewHost;
|
||||
final private ParentContainerCallbacks mParentContainerCallbacks;
|
||||
|
||||
public SplitWindowManager(Context context, Configuration config, SurfaceControl rootSurface) {
|
||||
super(config, rootSurface, null /* hostInputToken */);
|
||||
public interface ParentContainerCallbacks {
|
||||
void attachToParentSurface(SurfaceControl.Builder b);
|
||||
}
|
||||
|
||||
public SplitWindowManager(Context context, Configuration config,
|
||||
ParentContainerCallbacks parentContainerCallbacks) {
|
||||
super(config, null /* rootSurface */, null /* hostInputToken */);
|
||||
mContext = context.createConfigurationContext(config);
|
||||
mParentContainerCallbacks = parentContainerCallbacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,6 +80,11 @@ public final class SplitWindowManager extends WindowlessWindowManager {
|
||||
mContext = mContext.createConfigurationContext(configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachToParentSurface(SurfaceControl.Builder b) {
|
||||
mParentContainerCallbacks.attachToParentSurface(b);
|
||||
}
|
||||
|
||||
/** Inflates {@link DividerView} on to the root surface. */
|
||||
void init(SplitLayout splitLayout) {
|
||||
if (mViewHost == null) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import androidx.annotation.VisibleForTesting;
|
||||
import com.android.wm.shell.common.DisplayController;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Manages the hide display cutout status.
|
||||
@@ -51,7 +52,7 @@ public class HideDisplayCutoutController implements HideDisplayCutout {
|
||||
*/
|
||||
@Nullable
|
||||
public static HideDisplayCutoutController create(
|
||||
Context context, DisplayController displayController) {
|
||||
Context context, DisplayController displayController, Executor executor) {
|
||||
// The SystemProperty is set for devices that support this feature and is used to control
|
||||
// whether to create the HideDisplayCutout instance.
|
||||
// It's defined in the device.mk (e.g. device/google/crosshatch/device.mk).
|
||||
@@ -60,7 +61,7 @@ public class HideDisplayCutoutController implements HideDisplayCutout {
|
||||
}
|
||||
|
||||
HideDisplayCutoutOrganizer organizer =
|
||||
new HideDisplayCutoutOrganizer(context, displayController);
|
||||
new HideDisplayCutoutOrganizer(context, displayController, executor);
|
||||
return new HideDisplayCutoutController(context, organizer);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.android.wm.shell.common.DisplayController;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Manages the display areas of hide display cutout feature.
|
||||
@@ -88,7 +89,9 @@ class HideDisplayCutoutOrganizer extends DisplayAreaOrganizer {
|
||||
t.apply();
|
||||
};
|
||||
|
||||
HideDisplayCutoutOrganizer(Context context, DisplayController displayController) {
|
||||
HideDisplayCutoutOrganizer(Context context, DisplayController displayController,
|
||||
Executor executor) {
|
||||
super(executor);
|
||||
mContext = context;
|
||||
mDisplayController = displayController;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.android.wm.shell.common.TaskStackListenerImpl;
|
||||
import com.android.wm.shell.onehanded.OneHandedGestureHandler.OneHandedGestureEventCallback;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Manages and manipulates the one handed states, transitions, and gesture for phones.
|
||||
@@ -169,7 +170,7 @@ public class OneHandedController implements OneHanded {
|
||||
@Nullable
|
||||
public static OneHandedController create(
|
||||
Context context, DisplayController displayController,
|
||||
TaskStackListenerImpl taskStackListener) {
|
||||
TaskStackListenerImpl taskStackListener, Executor executor) {
|
||||
if (!SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false)) {
|
||||
Slog.w(TAG, "Device doesn't support OneHanded feature");
|
||||
return null;
|
||||
@@ -182,7 +183,7 @@ public class OneHandedController implements OneHanded {
|
||||
OneHandedGestureHandler gestureHandler = new OneHandedGestureHandler(
|
||||
context, displayController);
|
||||
OneHandedDisplayAreaOrganizer organizer = new OneHandedDisplayAreaOrganizer(
|
||||
context, displayController, animationController, tutorialHandler);
|
||||
context, displayController, animationController, tutorialHandler, executor);
|
||||
IOverlayManager overlayManager = IOverlayManager.Stub.asInterface(
|
||||
ServiceManager.getService(Context.OVERLAY_SERVICE));
|
||||
return new OneHandedController(context, displayController, organizer, touchHandler,
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
* Manages OneHanded display areas such as offset.
|
||||
@@ -151,7 +152,8 @@ public class OneHandedDisplayAreaOrganizer extends DisplayAreaOrganizer {
|
||||
public OneHandedDisplayAreaOrganizer(Context context,
|
||||
DisplayController displayController,
|
||||
OneHandedAnimationController animationController,
|
||||
OneHandedTutorialHandler tutorialHandler) {
|
||||
OneHandedTutorialHandler tutorialHandler, Executor executor) {
|
||||
super(executor);
|
||||
mUpdateHandler = new Handler(OneHandedThread.get().getLooper(), mUpdateCallback);
|
||||
mAnimationController = animationController;
|
||||
mDisplayController = displayController;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SplitLayoutTests extends ShellTestCase {
|
||||
mContext,
|
||||
getConfiguration(false),
|
||||
mLayoutChangeListener,
|
||||
mRootLeash);
|
||||
b -> b.setParent(mRootLeash));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -49,7 +49,8 @@ public class SplitWindowManagerTests extends ShellTestCase {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
final Configuration configuration = new Configuration();
|
||||
configuration.setToDefaults();
|
||||
mSplitWindowManager = new SplitWindowManager(mContext, configuration, mSurfaceControl);
|
||||
mSplitWindowManager = new SplitWindowManager(mContext, configuration,
|
||||
b -> b.setParent(mSurfaceControl));
|
||||
when(mSplitLayout.getDividerBounds()).thenReturn(
|
||||
new Rect(0, 0, configuration.windowConfiguration.getBounds().width(),
|
||||
configuration.windowConfiguration.getBounds().height()));
|
||||
|
||||
@@ -93,7 +93,7 @@ public class HideDisplayCutoutOrganizerTest {
|
||||
when(mMockDisplayController.getDisplay(anyInt())).thenReturn(mDisplay);
|
||||
|
||||
HideDisplayCutoutOrganizer organizer = new HideDisplayCutoutOrganizer(
|
||||
mContext, mMockDisplayController);
|
||||
mContext, mMockDisplayController, Runnable::run);
|
||||
mOrganizer = Mockito.spy(organizer);
|
||||
doNothing().when(mOrganizer).unregisterOrganizer();
|
||||
doNothing().when(mOrganizer).applyBoundsAndOffsets(any(), any(), any(), any());
|
||||
|
||||
@@ -93,7 +93,8 @@ public class OneHandedControllerTest extends OneHandedTestCase {
|
||||
final OneHandedAnimationController animationController = new OneHandedAnimationController(
|
||||
mContext);
|
||||
OneHandedDisplayAreaOrganizer displayAreaOrganizer = new OneHandedDisplayAreaOrganizer(
|
||||
mContext, mMockDisplayController, animationController, mMockTutorialHandler);
|
||||
mContext, mMockDisplayController, animationController, mMockTutorialHandler,
|
||||
Runnable::run);
|
||||
|
||||
assertThat(displayAreaOrganizer.isInOneHanded()).isFalse();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,8 @@ public class OneHandedDisplayAreaOrganizerTest extends OneHandedTestCase {
|
||||
mDisplayAreaOrganizer = new OneHandedDisplayAreaOrganizer(mContext,
|
||||
mMockDisplayController,
|
||||
mMockAnimationController,
|
||||
mTutorialHandler);
|
||||
mTutorialHandler,
|
||||
Runnable::run);
|
||||
mSpyUpdateHandler = spy(new Handler(OneHandedThread.get().getLooper(), mUpdateCallback));
|
||||
mDisplayAreaOrganizer.setUpdateHandler(mSpyUpdateHandler);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.systemui.dagger.WMSingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.wm.shell.FullscreenTaskListener;
|
||||
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
|
||||
import com.android.wm.shell.ShellCommandHandler;
|
||||
import com.android.wm.shell.ShellInit;
|
||||
import com.android.wm.shell.ShellTaskOrganizer;
|
||||
@@ -286,6 +287,13 @@ public abstract class WMShellBaseModule {
|
||||
return new ShellTaskOrganizer(mainExecutor, context);
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static RootTaskDisplayAreaOrganizer provideRootTaskDisplayAreaOrganizer(
|
||||
@ShellMainThread ShellExecutor mainExecutor, Context context) {
|
||||
return new RootTaskDisplayAreaOrganizer(mainExecutor);
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static TaskStackListenerImpl providerTaskStackListenerImpl(@Main Handler handler) {
|
||||
@@ -317,16 +325,18 @@ public abstract class WMShellBaseModule {
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<OneHanded> provideOneHandedController(Context context,
|
||||
DisplayController displayController, TaskStackListenerImpl taskStackListener) {
|
||||
DisplayController displayController, TaskStackListenerImpl taskStackListener,
|
||||
@ShellMainThread ShellExecutor mainExecutor) {
|
||||
return Optional.ofNullable(OneHandedController.create(context, displayController,
|
||||
taskStackListener));
|
||||
taskStackListener, mainExecutor));
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<HideDisplayCutout> provideHideDisplayCutoutController(Context context,
|
||||
DisplayController displayController) {
|
||||
return Optional.ofNullable(HideDisplayCutoutController.create(context, displayController));
|
||||
DisplayController displayController, @ShellMainThread ShellExecutor mainExecutor) {
|
||||
return Optional.ofNullable(
|
||||
HideDisplayCutoutController.create(context, displayController, mainExecutor));
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
|
||||
Reference in New Issue
Block a user