Loading core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java +0 −5 Original line number Diff line number Diff line Loading @@ -413,11 +413,6 @@ public final class SystemUiDeviceConfigFlags { public static final String DARK_LAUNCH_REMOTE_PREDICTION_SERVICE_ENABLED = "dark_launch_remote_prediction_service_enabled"; /** * (boolean) Whether to enable pinch resizing for PIP. */ public static final String PIP_PINCH_RESIZE = "pip_pinch_resize"; /** * (boolean) Whether to enable stashing for PIP. */ Loading libs/WindowManager/Shell/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ if a custom action is present before closing it. --> <integer name="config_pipForceCloseDelay">1000</integer> <!-- Allow PIP to resize via pinch gesture. --> <bool name="config_pipEnablePinchResize">true</bool> <!-- Animation duration when using long press on recents to dock --> <integer name="long_press_dock_anim_duration">250</integer> Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +2 −17 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.wm.shell.pip.phone; import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.PIP_PINCH_RESIZE; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_BOTTOM; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_LEFT; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_NONE; Loading @@ -31,7 +30,6 @@ import android.graphics.Rect; import android.graphics.Region; import android.hardware.input.InputManager; import android.os.Looper; import android.provider.DeviceConfig; import android.view.BatchedInputEventReceiver; import android.view.Choreographer; import android.view.InputChannel; Loading Loading @@ -155,21 +153,8 @@ public class PipResizeGestureHandler { mContext.getDisplay().getRealSize(mMaxSize); reloadResources(); mEnablePinchResize = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SYSTEMUI, PIP_PINCH_RESIZE, /* defaultValue = */ true); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI, mMainExecutor, new DeviceConfig.OnPropertiesChangedListener() { @Override public void onPropertiesChanged(DeviceConfig.Properties properties) { if (properties.getKeyset().contains(PIP_PINCH_RESIZE)) { mEnablePinchResize = properties.getBoolean( PIP_PINCH_RESIZE, /* defaultValue = */ true); } } }); final Resources res = mContext.getResources(); mEnablePinchResize = res.getBoolean(R.bool.config_pipEnablePinchResize); } public void onConfigurationChanged() { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -28,11 +28,13 @@ import static org.mockito.Mockito.verify; import android.graphics.Rect; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.testing.TestableResources; import android.view.MotionEvent; import android.view.ViewConfiguration; import androidx.test.filters.SmallTest; import com.android.wm.shell.R; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.common.ShellExecutor; Loading Loading @@ -98,6 +100,9 @@ public class PipResizeGestureHandlerTest extends ShellTestCase { @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); final TestableResources res = mContext.getOrCreateTestableResources(); res.addOverride(R.bool.config_pipEnablePinchResize, true); mPipDisplayLayoutState = new PipDisplayLayoutState(mContext); mSizeSpecSource = new PhoneSizeSpecSource(mContext, mPipDisplayLayoutState); mPipBoundsState = new PipBoundsState(mContext, mSizeSpecSource, mPipDisplayLayoutState); Loading Loading
core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java +0 −5 Original line number Diff line number Diff line Loading @@ -413,11 +413,6 @@ public final class SystemUiDeviceConfigFlags { public static final String DARK_LAUNCH_REMOTE_PREDICTION_SERVICE_ENABLED = "dark_launch_remote_prediction_service_enabled"; /** * (boolean) Whether to enable pinch resizing for PIP. */ public static final String PIP_PINCH_RESIZE = "pip_pinch_resize"; /** * (boolean) Whether to enable stashing for PIP. */ Loading
libs/WindowManager/Shell/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ if a custom action is present before closing it. --> <integer name="config_pipForceCloseDelay">1000</integer> <!-- Allow PIP to resize via pinch gesture. --> <bool name="config_pipEnablePinchResize">true</bool> <!-- Animation duration when using long press on recents to dock --> <integer name="long_press_dock_anim_duration">250</integer> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +2 −17 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.wm.shell.pip.phone; import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.PIP_PINCH_RESIZE; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_BOTTOM; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_LEFT; import static com.android.internal.policy.TaskResizingAlgorithm.CTRL_NONE; Loading @@ -31,7 +30,6 @@ import android.graphics.Rect; import android.graphics.Region; import android.hardware.input.InputManager; import android.os.Looper; import android.provider.DeviceConfig; import android.view.BatchedInputEventReceiver; import android.view.Choreographer; import android.view.InputChannel; Loading Loading @@ -155,21 +153,8 @@ public class PipResizeGestureHandler { mContext.getDisplay().getRealSize(mMaxSize); reloadResources(); mEnablePinchResize = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SYSTEMUI, PIP_PINCH_RESIZE, /* defaultValue = */ true); DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI, mMainExecutor, new DeviceConfig.OnPropertiesChangedListener() { @Override public void onPropertiesChanged(DeviceConfig.Properties properties) { if (properties.getKeyset().contains(PIP_PINCH_RESIZE)) { mEnablePinchResize = properties.getBoolean( PIP_PINCH_RESIZE, /* defaultValue = */ true); } } }); final Resources res = mContext.getResources(); mEnablePinchResize = res.getBoolean(R.bool.config_pipEnablePinchResize); } public void onConfigurationChanged() { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -28,11 +28,13 @@ import static org.mockito.Mockito.verify; import android.graphics.Rect; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.testing.TestableResources; import android.view.MotionEvent; import android.view.ViewConfiguration; import androidx.test.filters.SmallTest; import com.android.wm.shell.R; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.common.ShellExecutor; Loading Loading @@ -98,6 +100,9 @@ public class PipResizeGestureHandlerTest extends ShellTestCase { @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); final TestableResources res = mContext.getOrCreateTestableResources(); res.addOverride(R.bool.config_pipEnablePinchResize, true); mPipDisplayLayoutState = new PipDisplayLayoutState(mContext); mSizeSpecSource = new PhoneSizeSpecSource(mContext, mPipDisplayLayoutState); mPipBoundsState = new PipBoundsState(mContext, mSizeSpecSource, mPipDisplayLayoutState); Loading