Remove unused interfaces and controllers
- Some interfaces only existed to propagate configuration or keyguard changes which now go through the ShellController. TaskSurfaceHelper is no longer used since game dashboard has moved to GMS. Bug: 238217847 Test: atest WMShellUnitTests Change-Id: Ie8c5a77bf7bd5b8cc5f4a1b2382013228b1e5e3d
This commit is contained in:
@@ -28,6 +28,13 @@ import com.android.wm.shell.common.annotations.ExternalThread;
|
||||
@ExternalThread
|
||||
public interface BackAnimation {
|
||||
|
||||
/**
|
||||
* Returns a binder that can be passed to an external process to update back animations.
|
||||
*/
|
||||
default IBackAnimation createExternalInterface() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a {@link MotionEvent} is generated by a back gesture.
|
||||
*
|
||||
@@ -46,13 +53,6 @@ public interface BackAnimation {
|
||||
*/
|
||||
void setTriggerBack(boolean triggerBack);
|
||||
|
||||
/**
|
||||
* Returns a binder that can be passed to an external process to update back animations.
|
||||
*/
|
||||
default IBackAnimation createExternalInterface() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the threshold values that defining edge swipe behavior.
|
||||
* @param triggerThreshold the min threshold to trigger back.
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.compatui;
|
||||
|
||||
import com.android.wm.shell.common.annotations.ExternalThread;
|
||||
|
||||
/**
|
||||
* Interface to engage compat UI.
|
||||
*/
|
||||
@ExternalThread
|
||||
public interface CompatUI {
|
||||
}
|
||||
@@ -39,7 +39,6 @@ import com.android.wm.shell.common.DisplayInsetsController.OnInsetsChangedListen
|
||||
import com.android.wm.shell.common.DisplayLayout;
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
import com.android.wm.shell.common.SyncTransactionQueue;
|
||||
import com.android.wm.shell.common.annotations.ExternalThread;
|
||||
import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
|
||||
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
|
||||
import com.android.wm.shell.sysui.KeyguardChangeListener;
|
||||
@@ -109,7 +108,6 @@ public class CompatUIController implements OnDisplaysChangedListener,
|
||||
private final SyncTransactionQueue mSyncQueue;
|
||||
private final ShellExecutor mMainExecutor;
|
||||
private final Lazy<Transitions> mTransitionsLazy;
|
||||
private final CompatUIImpl mImpl = new CompatUIImpl();
|
||||
|
||||
private CompatUICallback mCallback;
|
||||
|
||||
@@ -142,11 +140,6 @@ public class CompatUIController implements OnDisplaysChangedListener,
|
||||
shellController.addKeyguardChangeListener(this);
|
||||
}
|
||||
|
||||
/** Returns implementation of {@link CompatUI}. */
|
||||
public CompatUI asCompatUI() {
|
||||
return mImpl;
|
||||
}
|
||||
|
||||
/** Sets the callback for UI interactions. */
|
||||
public void setCompatUICallback(CompatUICallback callback) {
|
||||
mCallback = callback;
|
||||
@@ -380,13 +373,6 @@ public class CompatUIController implements OnDisplaysChangedListener,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The interface for calls from outside the Shell, within the host process.
|
||||
*/
|
||||
@ExternalThread
|
||||
private class CompatUIImpl implements CompatUI {
|
||||
}
|
||||
|
||||
/** An implementation of {@link OnInsetsChangedListener} for a given display id. */
|
||||
private class PerDisplayOnInsetsChangedListener implements OnInsetsChangedListener {
|
||||
final int mDisplayId;
|
||||
|
||||
@@ -57,15 +57,12 @@ import com.android.wm.shell.common.annotations.ShellAnimationThread;
|
||||
import com.android.wm.shell.common.annotations.ShellBackgroundThread;
|
||||
import com.android.wm.shell.common.annotations.ShellMainThread;
|
||||
import com.android.wm.shell.common.annotations.ShellSplashscreenThread;
|
||||
import com.android.wm.shell.compatui.CompatUI;
|
||||
import com.android.wm.shell.compatui.CompatUIController;
|
||||
import com.android.wm.shell.displayareahelper.DisplayAreaHelper;
|
||||
import com.android.wm.shell.displayareahelper.DisplayAreaHelperController;
|
||||
import com.android.wm.shell.draganddrop.DragAndDrop;
|
||||
import com.android.wm.shell.draganddrop.DragAndDropController;
|
||||
import com.android.wm.shell.freeform.FreeformTaskListener;
|
||||
import com.android.wm.shell.fullscreen.FullscreenTaskListener;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutoutController;
|
||||
import com.android.wm.shell.kidsmode.KidsModeTaskOrganizer;
|
||||
import com.android.wm.shell.onehanded.OneHanded;
|
||||
@@ -85,8 +82,6 @@ import com.android.wm.shell.startingsurface.StartingWindowTypeAlgorithm;
|
||||
import com.android.wm.shell.startingsurface.phone.PhoneStartingWindowTypeAlgorithm;
|
||||
import com.android.wm.shell.sysui.ShellController;
|
||||
import com.android.wm.shell.sysui.ShellInterface;
|
||||
import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelper;
|
||||
import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelperController;
|
||||
import com.android.wm.shell.transition.ShellTransitions;
|
||||
import com.android.wm.shell.transition.Transitions;
|
||||
import com.android.wm.shell.unfold.ShellUnfoldProgressProvider;
|
||||
@@ -171,12 +166,6 @@ public abstract class WMShellBaseModule {
|
||||
iconProvider, mainExecutor);
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<DragAndDrop> provideDragAndDrop(DragAndDropController dragAndDropController) {
|
||||
return Optional.of(dragAndDropController.asDragAndDrop());
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static ShellTaskOrganizer provideShellTaskOrganizer(@ShellMainThread ShellExecutor mainExecutor,
|
||||
@@ -206,11 +195,6 @@ public abstract class WMShellBaseModule {
|
||||
recentTasksOptional);
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides static Optional<CompatUI> provideCompatUI(CompatUIController compatUIController) {
|
||||
return Optional.of(compatUIController.asCompatUI());
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static CompatUIController provideCompatUIController(Context context,
|
||||
@@ -374,13 +358,6 @@ public abstract class WMShellBaseModule {
|
||||
// Hide display cutout
|
||||
//
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<HideDisplayCutout> provideHideDisplayCutout(
|
||||
Optional<HideDisplayCutoutController> hideDisplayCutoutController) {
|
||||
return hideDisplayCutoutController.map((controller) -> controller.asHideDisplayCutout());
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<HideDisplayCutoutController> provideHideDisplayCutoutController(Context context,
|
||||
@@ -416,23 +393,6 @@ public abstract class WMShellBaseModule {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
//
|
||||
// Task to Surface communication
|
||||
//
|
||||
|
||||
@WMSingleton
|
||||
@Provides
|
||||
static Optional<TaskSurfaceHelper> provideTaskSurfaceHelper(
|
||||
Optional<TaskSurfaceHelperController> taskSurfaceController) {
|
||||
return taskSurfaceController.map((controller) -> controller.asTaskSurfaceHelper());
|
||||
}
|
||||
|
||||
@Provides
|
||||
static Optional<TaskSurfaceHelperController> provideTaskSurfaceHelperController(
|
||||
ShellTaskOrganizer taskOrganizer, @ShellMainThread ShellExecutor mainExecutor) {
|
||||
return Optional.ofNullable(new TaskSurfaceHelperController(taskOrganizer, mainExecutor));
|
||||
}
|
||||
|
||||
//
|
||||
// Pip (optional feature)
|
||||
//
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* 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.draganddrop;
|
||||
|
||||
import com.android.wm.shell.common.annotations.ExternalThread;
|
||||
|
||||
/**
|
||||
* Interface for telling DragAndDrop stuff.
|
||||
*/
|
||||
@ExternalThread
|
||||
public interface DragAndDrop {
|
||||
}
|
||||
@@ -81,11 +81,9 @@ public class DragAndDropController implements DisplayController.OnDisplaysChange
|
||||
private final IconProvider mIconProvider;
|
||||
private SplitScreenController mSplitScreen;
|
||||
private ShellExecutor mMainExecutor;
|
||||
private DragAndDropImpl mImpl;
|
||||
private ArrayList<DragAndDropListener> mListeners = new ArrayList<>();
|
||||
|
||||
private final SparseArray<PerDisplay> mDisplayDropTargets = new SparseArray<>();
|
||||
private final SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction();
|
||||
|
||||
/**
|
||||
* Listener called during drag events, currently just onDragStarted.
|
||||
@@ -107,11 +105,6 @@ public class DragAndDropController implements DisplayController.OnDisplaysChange
|
||||
mLogger = new DragAndDropEventLogger(uiEventLogger);
|
||||
mIconProvider = iconProvider;
|
||||
mMainExecutor = mainExecutor;
|
||||
mImpl = new DragAndDropImpl();
|
||||
}
|
||||
|
||||
public DragAndDrop asDragAndDrop() {
|
||||
return mImpl;
|
||||
}
|
||||
|
||||
public void initialize(Optional<SplitScreenController> splitscreen) {
|
||||
@@ -353,8 +346,4 @@ public class DragAndDropController implements DisplayController.OnDisplaysChange
|
||||
dragLayout = dl;
|
||||
}
|
||||
}
|
||||
|
||||
private class DragAndDropImpl implements DragAndDrop {
|
||||
// TODO: To be removed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* 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.hidedisplaycutout;
|
||||
|
||||
import com.android.wm.shell.common.annotations.ExternalThread;
|
||||
|
||||
/**
|
||||
* Interface to engage hide display cutout feature.
|
||||
*/
|
||||
@ExternalThread
|
||||
public interface HideDisplayCutout {
|
||||
}
|
||||
@@ -40,8 +40,6 @@ public class HideDisplayCutoutController implements ConfigurationChangeListener
|
||||
private final Context mContext;
|
||||
private final ShellController mShellController;
|
||||
private final HideDisplayCutoutOrganizer mOrganizer;
|
||||
private final ShellExecutor mMainExecutor;
|
||||
private final HideDisplayCutoutImpl mImpl = new HideDisplayCutoutImpl();
|
||||
@VisibleForTesting
|
||||
boolean mEnabled;
|
||||
|
||||
@@ -62,23 +60,18 @@ public class HideDisplayCutoutController implements ConfigurationChangeListener
|
||||
|
||||
HideDisplayCutoutOrganizer organizer =
|
||||
new HideDisplayCutoutOrganizer(context, displayController, mainExecutor);
|
||||
return new HideDisplayCutoutController(context, shellController, organizer, mainExecutor);
|
||||
return new HideDisplayCutoutController(context, shellController, organizer);
|
||||
}
|
||||
|
||||
HideDisplayCutoutController(Context context, ShellController shellController,
|
||||
HideDisplayCutoutOrganizer organizer, ShellExecutor mainExecutor) {
|
||||
HideDisplayCutoutOrganizer organizer) {
|
||||
mContext = context;
|
||||
mShellController = shellController;
|
||||
mOrganizer = organizer;
|
||||
mMainExecutor = mainExecutor;
|
||||
updateStatus();
|
||||
mShellController.addConfigurationChangeListener(this);
|
||||
}
|
||||
|
||||
public HideDisplayCutout asHideDisplayCutout() {
|
||||
return mImpl;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void updateStatus() {
|
||||
// The config value is used for controlling enabling/disabling status of the feature and is
|
||||
@@ -112,8 +105,4 @@ public class HideDisplayCutoutController implements ConfigurationChangeListener
|
||||
pw.println(mEnabled);
|
||||
mOrganizer.dump(pw);
|
||||
}
|
||||
|
||||
private class HideDisplayCutoutImpl implements HideDisplayCutout {
|
||||
// TODO: To be removed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.tasksurfacehelper;
|
||||
|
||||
import android.app.ActivityManager.RunningTaskInfo;
|
||||
import android.graphics.Rect;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Interface to communicate with a Task's SurfaceControl.
|
||||
*/
|
||||
public interface TaskSurfaceHelper {
|
||||
|
||||
/** Sets the METADATA_GAME_MODE for the layer corresponding to the task **/
|
||||
default void setGameModeForTask(int taskId, int gameMode) {}
|
||||
|
||||
/** Takes a screenshot for a task **/
|
||||
default void screenshotTask(RunningTaskInfo taskInfo, Rect crop, Executor executor,
|
||||
Consumer<SurfaceControl.ScreenshotHardwareBuffer> consumer) {}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.tasksurfacehelper;
|
||||
|
||||
import android.app.ActivityManager.RunningTaskInfo;
|
||||
import android.graphics.Rect;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import com.android.wm.shell.ShellTaskOrganizer;
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Intermediary controller that communicates with {@link ShellTaskOrganizer} to send commands
|
||||
* to SurfaceControl.
|
||||
*/
|
||||
public class TaskSurfaceHelperController {
|
||||
|
||||
private final ShellTaskOrganizer mTaskOrganizer;
|
||||
private final ShellExecutor mMainExecutor;
|
||||
private final TaskSurfaceHelperImpl mImpl = new TaskSurfaceHelperImpl();
|
||||
|
||||
public TaskSurfaceHelperController(ShellTaskOrganizer taskOrganizer,
|
||||
ShellExecutor mainExecutor) {
|
||||
mTaskOrganizer = taskOrganizer;
|
||||
mMainExecutor = mainExecutor;
|
||||
}
|
||||
|
||||
public TaskSurfaceHelper asTaskSurfaceHelper() {
|
||||
return mImpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a Transaction to set the game mode metadata on the
|
||||
* corresponding SurfaceControl
|
||||
*/
|
||||
public void setGameModeForTask(int taskId, int gameMode) {
|
||||
mTaskOrganizer.setSurfaceMetadata(taskId, SurfaceControl.METADATA_GAME_MODE, gameMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take screenshot of the specified task.
|
||||
*/
|
||||
public void screenshotTask(RunningTaskInfo taskInfo, Rect crop,
|
||||
Consumer<SurfaceControl.ScreenshotHardwareBuffer> consumer) {
|
||||
mTaskOrganizer.screenshotTask(taskInfo, crop, consumer);
|
||||
}
|
||||
|
||||
private class TaskSurfaceHelperImpl implements TaskSurfaceHelper {
|
||||
@Override
|
||||
public void setGameModeForTask(int taskId, int gameMode) {
|
||||
mMainExecutor.execute(() -> {
|
||||
TaskSurfaceHelperController.this.setGameModeForTask(taskId, gameMode);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void screenshotTask(RunningTaskInfo taskInfo, Rect crop, Executor executor,
|
||||
Consumer<SurfaceControl.ScreenshotHardwareBuffer> consumer) {
|
||||
mMainExecutor.execute(() -> {
|
||||
TaskSurfaceHelperController.this.screenshotTask(taskInfo, crop,
|
||||
(t) -> executor.execute(() -> consumer.accept(t)));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import androidx.test.filters.SmallTest;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
|
||||
import com.android.wm.shell.ShellTestCase;
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
import com.android.wm.shell.sysui.ShellController;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -49,8 +48,6 @@ public class HideDisplayCutoutControllerTest extends ShellTestCase {
|
||||
private ShellController mShellController;
|
||||
@Mock
|
||||
private HideDisplayCutoutOrganizer mMockDisplayAreaOrganizer;
|
||||
@Mock
|
||||
private ShellExecutor mMockMainExecutor;
|
||||
|
||||
private HideDisplayCutoutController mHideDisplayCutoutController;
|
||||
|
||||
@@ -58,7 +55,7 @@ public class HideDisplayCutoutControllerTest extends ShellTestCase {
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mHideDisplayCutoutController = new HideDisplayCutoutController(
|
||||
mContext, mShellController, mMockDisplayAreaOrganizer, mMockMainExecutor);
|
||||
mContext, mShellController, mMockDisplayAreaOrganizer);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.tasksurfacehelper;
|
||||
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import android.testing.AndroidTestingRunner;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.wm.shell.ShellTaskOrganizer;
|
||||
import com.android.wm.shell.ShellTestCase;
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@SmallTest
|
||||
public class TaskSurfaceHelperControllerTest extends ShellTestCase {
|
||||
private TaskSurfaceHelperController mTaskSurfaceHelperController;
|
||||
@Mock
|
||||
private ShellTaskOrganizer mMockTaskOrganizer;
|
||||
@Mock
|
||||
private ShellExecutor mMockShellExecutor;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mTaskSurfaceHelperController = new TaskSurfaceHelperController(
|
||||
mMockTaskOrganizer, mMockShellExecutor);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetGameModeForTask() {
|
||||
mTaskSurfaceHelperController.setGameModeForTask(/*taskId*/1, /*gameMode*/3);
|
||||
verify(mMockTaskOrganizer).setSurfaceMetadata(1, SurfaceControl.METADATA_GAME_MODE, 3);
|
||||
}
|
||||
}
|
||||
@@ -96,16 +96,12 @@ public abstract class SystemUIInitializer {
|
||||
.setSplitScreen(mWMComponent.getSplitScreen())
|
||||
.setOneHanded(mWMComponent.getOneHanded())
|
||||
.setBubbles(mWMComponent.getBubbles())
|
||||
.setHideDisplayCutout(mWMComponent.getHideDisplayCutout())
|
||||
.setShellCommandHandler(mWMComponent.getShellCommandHandler())
|
||||
.setTaskViewFactory(mWMComponent.getTaskViewFactory())
|
||||
.setTransitions(mWMComponent.getTransitions())
|
||||
.setStartingSurface(mWMComponent.getStartingSurface())
|
||||
.setDisplayAreaHelper(mWMComponent.getDisplayAreaHelper())
|
||||
.setTaskSurfaceHelper(mWMComponent.getTaskSurfaceHelper())
|
||||
.setRecentTasks(mWMComponent.getRecentTasks())
|
||||
.setCompatUI(mWMComponent.getCompatUI())
|
||||
.setDragAndDrop(mWMComponent.getDragAndDrop())
|
||||
.setBackAnimation(mWMComponent.getBackAnimation());
|
||||
} else {
|
||||
// TODO: Call on prepareSysUIComponentBuilder but not with real components. Other option
|
||||
@@ -116,16 +112,12 @@ public abstract class SystemUIInitializer {
|
||||
.setSplitScreen(Optional.ofNullable(null))
|
||||
.setOneHanded(Optional.ofNullable(null))
|
||||
.setBubbles(Optional.ofNullable(null))
|
||||
.setHideDisplayCutout(Optional.ofNullable(null))
|
||||
.setShellCommandHandler(Optional.ofNullable(null))
|
||||
.setTaskViewFactory(Optional.ofNullable(null))
|
||||
.setTransitions(new ShellTransitions() {})
|
||||
.setDisplayAreaHelper(Optional.ofNullable(null))
|
||||
.setStartingSurface(Optional.ofNullable(null))
|
||||
.setTaskSurfaceHelper(Optional.ofNullable(null))
|
||||
.setRecentTasks(Optional.ofNullable(null))
|
||||
.setCompatUI(Optional.ofNullable(null))
|
||||
.setDragAndDrop(Optional.ofNullable(null))
|
||||
.setBackAnimation(Optional.ofNullable(null));
|
||||
}
|
||||
mSysUIComponent = builder.build();
|
||||
|
||||
@@ -41,17 +41,13 @@ import com.android.wm.shell.ShellCommandHandler;
|
||||
import com.android.wm.shell.TaskViewFactory;
|
||||
import com.android.wm.shell.back.BackAnimation;
|
||||
import com.android.wm.shell.bubbles.Bubbles;
|
||||
import com.android.wm.shell.compatui.CompatUI;
|
||||
import com.android.wm.shell.displayareahelper.DisplayAreaHelper;
|
||||
import com.android.wm.shell.draganddrop.DragAndDrop;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
|
||||
import com.android.wm.shell.onehanded.OneHanded;
|
||||
import com.android.wm.shell.pip.Pip;
|
||||
import com.android.wm.shell.recents.RecentTasks;
|
||||
import com.android.wm.shell.splitscreen.SplitScreen;
|
||||
import com.android.wm.shell.startingsurface.StartingSurface;
|
||||
import com.android.wm.shell.sysui.ShellInterface;
|
||||
import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelper;
|
||||
import com.android.wm.shell.transition.ShellTransitions;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -99,9 +95,6 @@ public interface SysUIComponent {
|
||||
@BindsInstance
|
||||
Builder setTaskViewFactory(Optional<TaskViewFactory> t);
|
||||
|
||||
@BindsInstance
|
||||
Builder setHideDisplayCutout(Optional<HideDisplayCutout> h);
|
||||
|
||||
@BindsInstance
|
||||
Builder setShellCommandHandler(Optional<ShellCommandHandler> shellDump);
|
||||
|
||||
@@ -114,18 +107,9 @@ public interface SysUIComponent {
|
||||
@BindsInstance
|
||||
Builder setDisplayAreaHelper(Optional<DisplayAreaHelper> h);
|
||||
|
||||
@BindsInstance
|
||||
Builder setTaskSurfaceHelper(Optional<TaskSurfaceHelper> t);
|
||||
|
||||
@BindsInstance
|
||||
Builder setRecentTasks(Optional<RecentTasks> r);
|
||||
|
||||
@BindsInstance
|
||||
Builder setCompatUI(Optional<CompatUI> s);
|
||||
|
||||
@BindsInstance
|
||||
Builder setDragAndDrop(Optional<DragAndDrop> d);
|
||||
|
||||
@BindsInstance
|
||||
Builder setBackAnimation(Optional<BackAnimation> b);
|
||||
|
||||
|
||||
@@ -29,20 +29,16 @@ import com.android.wm.shell.TaskViewFactory;
|
||||
import com.android.wm.shell.back.BackAnimation;
|
||||
import com.android.wm.shell.bubbles.Bubbles;
|
||||
import com.android.wm.shell.common.annotations.ShellMainThread;
|
||||
import com.android.wm.shell.compatui.CompatUI;
|
||||
import com.android.wm.shell.dagger.TvWMShellModule;
|
||||
import com.android.wm.shell.dagger.WMShellModule;
|
||||
import com.android.wm.shell.dagger.WMSingleton;
|
||||
import com.android.wm.shell.displayareahelper.DisplayAreaHelper;
|
||||
import com.android.wm.shell.draganddrop.DragAndDrop;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
|
||||
import com.android.wm.shell.onehanded.OneHanded;
|
||||
import com.android.wm.shell.pip.Pip;
|
||||
import com.android.wm.shell.recents.RecentTasks;
|
||||
import com.android.wm.shell.splitscreen.SplitScreen;
|
||||
import com.android.wm.shell.startingsurface.StartingSurface;
|
||||
import com.android.wm.shell.sysui.ShellInterface;
|
||||
import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelper;
|
||||
import com.android.wm.shell.transition.ShellTransitions;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -103,9 +99,6 @@ public interface WMComponent {
|
||||
@WMSingleton
|
||||
Optional<Bubbles> getBubbles();
|
||||
|
||||
@WMSingleton
|
||||
Optional<HideDisplayCutout> getHideDisplayCutout();
|
||||
|
||||
@WMSingleton
|
||||
Optional<TaskViewFactory> getTaskViewFactory();
|
||||
|
||||
@@ -118,18 +111,9 @@ public interface WMComponent {
|
||||
@WMSingleton
|
||||
Optional<DisplayAreaHelper> getDisplayAreaHelper();
|
||||
|
||||
@WMSingleton
|
||||
Optional<TaskSurfaceHelper> getTaskSurfaceHelper();
|
||||
|
||||
@WMSingleton
|
||||
Optional<RecentTasks> getRecentTasks();
|
||||
|
||||
@WMSingleton
|
||||
Optional<CompatUI> getCompatUI();
|
||||
|
||||
@WMSingleton
|
||||
Optional<DragAndDrop> getDragAndDrop();
|
||||
|
||||
@WMSingleton
|
||||
Optional<BackAnimation> getBackAnimation();
|
||||
}
|
||||
|
||||
@@ -55,9 +55,6 @@ import com.android.systemui.statusbar.policy.UserInfoController;
|
||||
import com.android.systemui.tracing.ProtoTracer;
|
||||
import com.android.systemui.tracing.nano.SystemUiTraceProto;
|
||||
import com.android.wm.shell.ShellCommandHandler;
|
||||
import com.android.wm.shell.compatui.CompatUI;
|
||||
import com.android.wm.shell.draganddrop.DragAndDrop;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
|
||||
import com.android.wm.shell.nano.WmShellTraceProto;
|
||||
import com.android.wm.shell.onehanded.OneHanded;
|
||||
import com.android.wm.shell.onehanded.OneHandedEventCallback;
|
||||
@@ -110,10 +107,7 @@ public final class WMShell extends CoreStartable
|
||||
private final Optional<Pip> mPipOptional;
|
||||
private final Optional<SplitScreen> mSplitScreenOptional;
|
||||
private final Optional<OneHanded> mOneHandedOptional;
|
||||
private final Optional<HideDisplayCutout> mHideDisplayCutoutOptional;
|
||||
private final Optional<ShellCommandHandler> mShellCommandHandler;
|
||||
private final Optional<CompatUI> mCompatUIOptional;
|
||||
private final Optional<DragAndDrop> mDragAndDropOptional;
|
||||
|
||||
private final CommandQueue mCommandQueue;
|
||||
private final ConfigurationController mConfigurationController;
|
||||
@@ -136,10 +130,7 @@ public final class WMShell extends CoreStartable
|
||||
Optional<Pip> pipOptional,
|
||||
Optional<SplitScreen> splitScreenOptional,
|
||||
Optional<OneHanded> oneHandedOptional,
|
||||
Optional<HideDisplayCutout> hideDisplayCutoutOptional,
|
||||
Optional<ShellCommandHandler> shellCommandHandler,
|
||||
Optional<CompatUI> sizeCompatUIOptional,
|
||||
Optional<DragAndDrop> dragAndDropOptional,
|
||||
CommandQueue commandQueue,
|
||||
ConfigurationController configurationController,
|
||||
KeyguardStateController keyguardStateController,
|
||||
@@ -161,12 +152,9 @@ public final class WMShell extends CoreStartable
|
||||
mPipOptional = pipOptional;
|
||||
mSplitScreenOptional = splitScreenOptional;
|
||||
mOneHandedOptional = oneHandedOptional;
|
||||
mHideDisplayCutoutOptional = hideDisplayCutoutOptional;
|
||||
mWakefulnessLifecycle = wakefulnessLifecycle;
|
||||
mProtoTracer = protoTracer;
|
||||
mShellCommandHandler = shellCommandHandler;
|
||||
mCompatUIOptional = sizeCompatUIOptional;
|
||||
mDragAndDropOptional = dragAndDropOptional;
|
||||
mUserInfoController = userInfoController;
|
||||
mSysUiMainExecutor = sysUiMainExecutor;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,6 @@ import com.android.systemui.statusbar.policy.UserInfoController;
|
||||
import com.android.systemui.tracing.ProtoTracer;
|
||||
import com.android.wm.shell.ShellCommandHandler;
|
||||
import com.android.wm.shell.common.ShellExecutor;
|
||||
import com.android.wm.shell.compatui.CompatUI;
|
||||
import com.android.wm.shell.draganddrop.DragAndDrop;
|
||||
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
|
||||
import com.android.wm.shell.onehanded.OneHanded;
|
||||
import com.android.wm.shell.onehanded.OneHandedEventCallback;
|
||||
import com.android.wm.shell.onehanded.OneHandedTransitionCallback;
|
||||
@@ -74,25 +71,20 @@ public class WMShellTest extends SysuiTestCase {
|
||||
@Mock Pip mPip;
|
||||
@Mock SplitScreen mSplitScreen;
|
||||
@Mock OneHanded mOneHanded;
|
||||
@Mock HideDisplayCutout mHideDisplayCutout;
|
||||
@Mock WakefulnessLifecycle mWakefulnessLifecycle;
|
||||
@Mock ProtoTracer mProtoTracer;
|
||||
@Mock ShellCommandHandler mShellCommandHandler;
|
||||
@Mock CompatUI mCompatUI;
|
||||
@Mock UserInfoController mUserInfoController;
|
||||
@Mock ShellExecutor mSysUiMainExecutor;
|
||||
@Mock DragAndDrop mDragAndDrop;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
mWMShell = new WMShell(mContext, mShellInterface, Optional.of(mPip),
|
||||
Optional.of(mSplitScreen), Optional.of(mOneHanded), Optional.of(mHideDisplayCutout),
|
||||
Optional.of(mShellCommandHandler), Optional.of(mCompatUI),
|
||||
Optional.of(mDragAndDrop),
|
||||
mCommandQueue, mConfigurationController, mKeyguardStateController,
|
||||
mKeyguardUpdateMonitor, mScreenLifecycle, mSysUiState,
|
||||
Optional.of(mSplitScreen), Optional.of(mOneHanded),
|
||||
Optional.of(mShellCommandHandler), mCommandQueue, mConfigurationController,
|
||||
mKeyguardStateController, mKeyguardUpdateMonitor, mScreenLifecycle, mSysUiState,
|
||||
mProtoTracer, mWakefulnessLifecycle, mUserInfoController, mSysUiMainExecutor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user