Loading libs/WindowManager/Shell/res/layout/split_decor.xml 0 → 100644 +30 −0 Original line number Original line Diff line number Diff line <!-- ~ 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. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <ImageView android:id="@+id/split_resizing_icon" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:padding="0dp" android:visibility="gone" android:background="@null"/> </FrameLayout> libs/WindowManager/Shell/res/layout/split_outline.xml +15 −14 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2021 The Android Open Source Project <!-- ~ 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. ~ Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at ~ 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 ~ ~ 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, ~ Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ distributed under the License is distributed on an "AS IS" BASIS, See the License for the specific language governing permissions and ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. limitations under the License. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> --> <FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" Loading libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandlerImpl.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -103,8 +103,6 @@ public final class ShellCommandHandlerImpl { return runMoveToSideStage(args, pw); return runMoveToSideStage(args, pw); case "removeFromSideStage": case "removeFromSideStage": return runRemoveFromSideStage(args, pw); return runRemoveFromSideStage(args, pw); case "setSideStageOutline": return runSetSideStageOutline(args, pw); case "setSideStagePosition": case "setSideStagePosition": return runSetSideStagePosition(args, pw); return runSetSideStagePosition(args, pw); case "setSideStageVisibility": case "setSideStageVisibility": Loading Loading @@ -163,18 +161,6 @@ public final class ShellCommandHandlerImpl { return true; return true; } } private boolean runSetSideStageOutline(String[] args, PrintWriter pw) { if (args.length < 3) { // First arguments are "WMShell" and command name. pw.println("Error: whether to enable or disable side stage outline border should be" + " provided as arguments"); return false; } final boolean enable = new Boolean(args[2]); mSplitScreenOptional.ifPresent(split -> split.setSideStageOutline(enable)); return true; } private boolean runSetSideStagePosition(String[] args, PrintWriter pw) { private boolean runSetSideStagePosition(String[] args, PrintWriter pw) { if (args.length < 3) { if (args.length < 3) { // First arguments are "WMShell" and command name. // First arguments are "WMShell" and command name. Loading libs/WindowManager/Shell/src/com/android/wm/shell/apppairs/AppPair.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -131,7 +131,8 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.SplitLayou mSplitLayout = new SplitLayout(TAG + "SplitDivider", mSplitLayout = new SplitLayout(TAG + "SplitDivider", mDisplayController.getDisplayContext(mRootTaskInfo.displayId), mDisplayController.getDisplayContext(mRootTaskInfo.displayId), mRootTaskInfo.configuration, this /* layoutChangeListener */, mRootTaskInfo.configuration, this /* layoutChangeListener */, mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer()); mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer(), true /* applyDismissingParallax */); mDisplayInsetsController.addInsetsChangedListener(mRootTaskInfo.displayId, mSplitLayout); mDisplayInsetsController.addInsetsChangedListener(mRootTaskInfo.displayId, mSplitLayout); final WindowContainerToken token1 = task1.token; final WindowContainerToken token1 = task1.token; Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java +11 −5 Original line number Original line Diff line number Diff line Loading @@ -23,16 +23,22 @@ import android.view.SurfaceSession; * Helpers for handling surface. * Helpers for handling surface. */ */ public class SurfaceUtils { public class SurfaceUtils { /** Creates a dim layer above indicated host surface. */ /** Creates a dim layer above host surface. */ public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host, public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host, String name, SurfaceSession surfaceSession) { String name, SurfaceSession surfaceSession) { SurfaceControl dimLayer = new SurfaceControl.Builder(surfaceSession) final SurfaceControl dimLayer = makeColorLayer(host, name, surfaceSession); t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f}); return dimLayer; } /** Creates a color layer for host surface. */ public static SurfaceControl makeColorLayer(SurfaceControl host, String name, SurfaceSession surfaceSession) { return new SurfaceControl.Builder(surfaceSession) .setParent(host) .setParent(host) .setColorLayer() .setColorLayer() .setName(name) .setName(name) .setCallsite("SurfaceUtils.makeDimLayer") .setCallsite("SurfaceUtils.makeColorLayer") .build(); .build(); t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f}); return dimLayer; } } } } Loading
libs/WindowManager/Shell/res/layout/split_decor.xml 0 → 100644 +30 −0 Original line number Original line Diff line number Diff line <!-- ~ 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. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <ImageView android:id="@+id/split_resizing_icon" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:padding="0dp" android:visibility="gone" android:background="@null"/> </FrameLayout>
libs/WindowManager/Shell/res/layout/split_outline.xml +15 −14 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2021 The Android Open Source Project <!-- ~ 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. ~ Licensed under the Apache License, Version 2.0 (the "License"); You may obtain a copy of the License at ~ 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 ~ ~ 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, ~ Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ distributed under the License is distributed on an "AS IS" BASIS, See the License for the specific language governing permissions and ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. limitations under the License. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> --> <FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandlerImpl.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -103,8 +103,6 @@ public final class ShellCommandHandlerImpl { return runMoveToSideStage(args, pw); return runMoveToSideStage(args, pw); case "removeFromSideStage": case "removeFromSideStage": return runRemoveFromSideStage(args, pw); return runRemoveFromSideStage(args, pw); case "setSideStageOutline": return runSetSideStageOutline(args, pw); case "setSideStagePosition": case "setSideStagePosition": return runSetSideStagePosition(args, pw); return runSetSideStagePosition(args, pw); case "setSideStageVisibility": case "setSideStageVisibility": Loading Loading @@ -163,18 +161,6 @@ public final class ShellCommandHandlerImpl { return true; return true; } } private boolean runSetSideStageOutline(String[] args, PrintWriter pw) { if (args.length < 3) { // First arguments are "WMShell" and command name. pw.println("Error: whether to enable or disable side stage outline border should be" + " provided as arguments"); return false; } final boolean enable = new Boolean(args[2]); mSplitScreenOptional.ifPresent(split -> split.setSideStageOutline(enable)); return true; } private boolean runSetSideStagePosition(String[] args, PrintWriter pw) { private boolean runSetSideStagePosition(String[] args, PrintWriter pw) { if (args.length < 3) { if (args.length < 3) { // First arguments are "WMShell" and command name. // First arguments are "WMShell" and command name. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/apppairs/AppPair.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -131,7 +131,8 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.SplitLayou mSplitLayout = new SplitLayout(TAG + "SplitDivider", mSplitLayout = new SplitLayout(TAG + "SplitDivider", mDisplayController.getDisplayContext(mRootTaskInfo.displayId), mDisplayController.getDisplayContext(mRootTaskInfo.displayId), mRootTaskInfo.configuration, this /* layoutChangeListener */, mRootTaskInfo.configuration, this /* layoutChangeListener */, mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer()); mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer(), true /* applyDismissingParallax */); mDisplayInsetsController.addInsetsChangedListener(mRootTaskInfo.displayId, mSplitLayout); mDisplayInsetsController.addInsetsChangedListener(mRootTaskInfo.displayId, mSplitLayout); final WindowContainerToken token1 = task1.token; final WindowContainerToken token1 = task1.token; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/SurfaceUtils.java +11 −5 Original line number Original line Diff line number Diff line Loading @@ -23,16 +23,22 @@ import android.view.SurfaceSession; * Helpers for handling surface. * Helpers for handling surface. */ */ public class SurfaceUtils { public class SurfaceUtils { /** Creates a dim layer above indicated host surface. */ /** Creates a dim layer above host surface. */ public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host, public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host, String name, SurfaceSession surfaceSession) { String name, SurfaceSession surfaceSession) { SurfaceControl dimLayer = new SurfaceControl.Builder(surfaceSession) final SurfaceControl dimLayer = makeColorLayer(host, name, surfaceSession); t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f}); return dimLayer; } /** Creates a color layer for host surface. */ public static SurfaceControl makeColorLayer(SurfaceControl host, String name, SurfaceSession surfaceSession) { return new SurfaceControl.Builder(surfaceSession) .setParent(host) .setParent(host) .setColorLayer() .setColorLayer() .setName(name) .setName(name) .setCallsite("SurfaceUtils.makeDimLayer") .setCallsite("SurfaceUtils.makeColorLayer") .build(); .build(); t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f}); return dimLayer; } } } }