Loading libs/WindowManager/Shell/res/values-television/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,10 @@ <!-- The default gravity for the picture-in-picture window. Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT --> <integer name="config_defaultPictureInPictureGravity">0x55</integer> <!-- Fraction of screen width/height restricted keep clear areas can move the PiP. --> <fraction name="config_pipMaxRestrictedMoveDistance">15%</fraction> <!-- Duration (in milliseconds) the PiP stays stashed before automatically unstashing. --> <integer name="config_pipStashDuration">5000</integer> </resources> libs/WindowManager/Shell/res/values-television/dimen.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 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. --> <!-- These resources are around just to allow their values to be customized for TV products. Do not translate. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Padding between PIP and keep clear areas that caused it to move. --> <dimen name="pip_keep_clear_area_padding">16dp</dimen> </resources> libs/WindowManager/Shell/src/com/android/wm/shell/dagger/TvPipModule.java +4 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ public abstract class TvPipModule { TaskStackListenerImpl taskStackListener, DisplayController displayController, WindowManagerShellWrapper windowManagerShellWrapper, @ShellMainThread ShellExecutor mainExecutor) { @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler) { return Optional.of( TvPipController.create( context, Loading @@ -83,7 +84,8 @@ public abstract class TvPipModule { taskStackListener, displayController, windowManagerShellWrapper, mainExecutor)); mainExecutor, mainHandler)); } @WMSingleton Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ public class PipBoundsAlgorithm { /** * TODO: move the resources to SysUI package. */ protected void reloadResources(Context context) { private void reloadResources(Context context) { final Resources res = context.getResources(); mDefaultAspectRatio = res.getFloat( R.dimen.config_pictureInPictureDefaultAspectRatio); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java +5 −1 Original line number Diff line number Diff line Loading @@ -55,11 +55,15 @@ public class PipBoundsState { public static final int STASH_TYPE_NONE = 0; public static final int STASH_TYPE_LEFT = 1; public static final int STASH_TYPE_RIGHT = 2; public static final int STASH_TYPE_BOTTOM = 3; public static final int STASH_TYPE_TOP = 4; @IntDef(prefix = { "STASH_TYPE_" }, value = { STASH_TYPE_NONE, STASH_TYPE_LEFT, STASH_TYPE_RIGHT STASH_TYPE_RIGHT, STASH_TYPE_BOTTOM, STASH_TYPE_TOP }) @Retention(RetentionPolicy.SOURCE) public @interface StashType {} Loading Loading
libs/WindowManager/Shell/res/values-television/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,10 @@ <!-- The default gravity for the picture-in-picture window. Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT --> <integer name="config_defaultPictureInPictureGravity">0x55</integer> <!-- Fraction of screen width/height restricted keep clear areas can move the PiP. --> <fraction name="config_pipMaxRestrictedMoveDistance">15%</fraction> <!-- Duration (in milliseconds) the PiP stays stashed before automatically unstashing. --> <integer name="config_pipStashDuration">5000</integer> </resources>
libs/WindowManager/Shell/res/values-television/dimen.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 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. --> <!-- These resources are around just to allow their values to be customized for TV products. Do not translate. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Padding between PIP and keep clear areas that caused it to move. --> <dimen name="pip_keep_clear_area_padding">16dp</dimen> </resources>
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/TvPipModule.java +4 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ public abstract class TvPipModule { TaskStackListenerImpl taskStackListener, DisplayController displayController, WindowManagerShellWrapper windowManagerShellWrapper, @ShellMainThread ShellExecutor mainExecutor) { @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler) { return Optional.of( TvPipController.create( context, Loading @@ -83,7 +84,8 @@ public abstract class TvPipModule { taskStackListener, displayController, windowManagerShellWrapper, mainExecutor)); mainExecutor, mainHandler)); } @WMSingleton Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ public class PipBoundsAlgorithm { /** * TODO: move the resources to SysUI package. */ protected void reloadResources(Context context) { private void reloadResources(Context context) { final Resources res = context.getResources(); mDefaultAspectRatio = res.getFloat( R.dimen.config_pictureInPictureDefaultAspectRatio); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java +5 −1 Original line number Diff line number Diff line Loading @@ -55,11 +55,15 @@ public class PipBoundsState { public static final int STASH_TYPE_NONE = 0; public static final int STASH_TYPE_LEFT = 1; public static final int STASH_TYPE_RIGHT = 2; public static final int STASH_TYPE_BOTTOM = 3; public static final int STASH_TYPE_TOP = 4; @IntDef(prefix = { "STASH_TYPE_" }, value = { STASH_TYPE_NONE, STASH_TYPE_LEFT, STASH_TYPE_RIGHT STASH_TYPE_RIGHT, STASH_TYPE_BOTTOM, STASH_TYPE_TOP }) @Retention(RetentionPolicy.SOURCE) public @interface StashType {} Loading