Refactoring rename of PipKeepClearAlgorithm
Renaming PipKeepClearAlgorithm to PipKeepClearAlgorithmInterface, to make an easier transition of moving TvPipKeepClearAlgorithm into shared PiP codebase. Test: n/a, refactoring code with IntelliJ, renaming interface Bug: 265207213 Change-Id: Ic16cd7eefa034259d5d7f141f2817eb4f7b597ec
This commit is contained in:
@@ -47,7 +47,7 @@ public class PipBoundsAlgorithm {
|
|||||||
|
|
||||||
private final @NonNull PipBoundsState mPipBoundsState;
|
private final @NonNull PipBoundsState mPipBoundsState;
|
||||||
private final PipSnapAlgorithm mSnapAlgorithm;
|
private final PipSnapAlgorithm mSnapAlgorithm;
|
||||||
private final PipKeepClearAlgorithm mPipKeepClearAlgorithm;
|
private final PipKeepClearAlgorithmInterface mPipKeepClearAlgorithm;
|
||||||
|
|
||||||
private float mDefaultSizePercent;
|
private float mDefaultSizePercent;
|
||||||
private float mMinAspectRatioForMinSize;
|
private float mMinAspectRatioForMinSize;
|
||||||
@@ -62,7 +62,7 @@ public class PipBoundsAlgorithm {
|
|||||||
|
|
||||||
public PipBoundsAlgorithm(Context context, @NonNull PipBoundsState pipBoundsState,
|
public PipBoundsAlgorithm(Context context, @NonNull PipBoundsState pipBoundsState,
|
||||||
@NonNull PipSnapAlgorithm pipSnapAlgorithm,
|
@NonNull PipSnapAlgorithm pipSnapAlgorithm,
|
||||||
@NonNull PipKeepClearAlgorithm pipKeepClearAlgorithm) {
|
@NonNull PipKeepClearAlgorithmInterface pipKeepClearAlgorithm) {
|
||||||
mPipBoundsState = pipBoundsState;
|
mPipBoundsState = pipBoundsState;
|
||||||
mSnapAlgorithm = pipSnapAlgorithm;
|
mSnapAlgorithm = pipSnapAlgorithm;
|
||||||
mPipKeepClearAlgorithm = pipKeepClearAlgorithm;
|
mPipKeepClearAlgorithm = pipKeepClearAlgorithm;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.Set;
|
|||||||
* Interface for interacting with keep clear algorithm used to move PiP window out of the way of
|
* Interface for interacting with keep clear algorithm used to move PiP window out of the way of
|
||||||
* keep clear areas.
|
* keep clear areas.
|
||||||
*/
|
*/
|
||||||
public interface PipKeepClearAlgorithm {
|
public interface PipKeepClearAlgorithmInterface {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the position of picture in picture window based on the registered keep clear areas.
|
* Adjust the position of picture in picture window based on the registered keep clear areas.
|
||||||
@@ -26,14 +26,14 @@ import android.view.Gravity;
|
|||||||
import com.android.wm.shell.R;
|
import com.android.wm.shell.R;
|
||||||
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipBoundsState;
|
import com.android.wm.shell.pip.PipBoundsState;
|
||||||
import com.android.wm.shell.pip.PipKeepClearAlgorithm;
|
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the adjusted position that does not occlude keep clear areas.
|
* Calculates the adjusted position that does not occlude keep clear areas.
|
||||||
*/
|
*/
|
||||||
public class PhonePipKeepClearAlgorithm implements PipKeepClearAlgorithm {
|
public class PhonePipKeepClearAlgorithm implements PipKeepClearAlgorithmInterface {
|
||||||
|
|
||||||
private boolean mKeepClearAreaGravityEnabled =
|
private boolean mKeepClearAreaGravityEnabled =
|
||||||
SystemProperties.getBoolean(
|
SystemProperties.getBoolean(
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ import android.content.res.Configuration;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.os.UserManager;
|
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.util.Size;
|
import android.util.Size;
|
||||||
import android.view.DisplayInfo;
|
import android.view.DisplayInfo;
|
||||||
@@ -85,7 +83,7 @@ import com.android.wm.shell.pip.PipAnimationController;
|
|||||||
import com.android.wm.shell.pip.PipAppOpsListener;
|
import com.android.wm.shell.pip.PipAppOpsListener;
|
||||||
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipBoundsState;
|
import com.android.wm.shell.pip.PipBoundsState;
|
||||||
import com.android.wm.shell.pip.PipKeepClearAlgorithm;
|
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
|
||||||
import com.android.wm.shell.pip.PipMediaController;
|
import com.android.wm.shell.pip.PipMediaController;
|
||||||
import com.android.wm.shell.pip.PipParamsChangedForwarder;
|
import com.android.wm.shell.pip.PipParamsChangedForwarder;
|
||||||
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
||||||
@@ -137,7 +135,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
|||||||
private PipAppOpsListener mAppOpsListener;
|
private PipAppOpsListener mAppOpsListener;
|
||||||
private PipMediaController mMediaController;
|
private PipMediaController mMediaController;
|
||||||
private PipBoundsAlgorithm mPipBoundsAlgorithm;
|
private PipBoundsAlgorithm mPipBoundsAlgorithm;
|
||||||
private PipKeepClearAlgorithm mPipKeepClearAlgorithm;
|
private PipKeepClearAlgorithmInterface mPipKeepClearAlgorithm;
|
||||||
private PipBoundsState mPipBoundsState;
|
private PipBoundsState mPipBoundsState;
|
||||||
private PipMotionHelper mPipMotionHelper;
|
private PipMotionHelper mPipMotionHelper;
|
||||||
private PipTouchHandler mTouchHandler;
|
private PipTouchHandler mTouchHandler;
|
||||||
@@ -380,7 +378,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
|||||||
PipAnimationController pipAnimationController,
|
PipAnimationController pipAnimationController,
|
||||||
PipAppOpsListener pipAppOpsListener,
|
PipAppOpsListener pipAppOpsListener,
|
||||||
PipBoundsAlgorithm pipBoundsAlgorithm,
|
PipBoundsAlgorithm pipBoundsAlgorithm,
|
||||||
PipKeepClearAlgorithm pipKeepClearAlgorithm,
|
PipKeepClearAlgorithmInterface pipKeepClearAlgorithm,
|
||||||
PipBoundsState pipBoundsState,
|
PipBoundsState pipBoundsState,
|
||||||
PipMotionHelper pipMotionHelper,
|
PipMotionHelper pipMotionHelper,
|
||||||
PipMediaController pipMediaController,
|
PipMediaController pipMediaController,
|
||||||
@@ -419,7 +417,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
|||||||
PipAnimationController pipAnimationController,
|
PipAnimationController pipAnimationController,
|
||||||
PipAppOpsListener pipAppOpsListener,
|
PipAppOpsListener pipAppOpsListener,
|
||||||
PipBoundsAlgorithm pipBoundsAlgorithm,
|
PipBoundsAlgorithm pipBoundsAlgorithm,
|
||||||
PipKeepClearAlgorithm pipKeepClearAlgorithm,
|
PipKeepClearAlgorithmInterface pipKeepClearAlgorithm,
|
||||||
@NonNull PipBoundsState pipBoundsState,
|
@NonNull PipBoundsState pipBoundsState,
|
||||||
PipMotionHelper pipMotionHelper,
|
PipMotionHelper pipMotionHelper,
|
||||||
PipMediaController pipMediaController,
|
PipMediaController pipMediaController,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import com.android.internal.protolog.common.ProtoLog;
|
|||||||
import com.android.wm.shell.R;
|
import com.android.wm.shell.R;
|
||||||
import com.android.wm.shell.common.DisplayLayout;
|
import com.android.wm.shell.common.DisplayLayout;
|
||||||
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipKeepClearAlgorithm;
|
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
|
||||||
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
||||||
import com.android.wm.shell.pip.tv.TvPipKeepClearAlgorithm.Placement;
|
import com.android.wm.shell.pip.tv.TvPipKeepClearAlgorithm.Placement;
|
||||||
import com.android.wm.shell.protolog.ShellProtoLogGroup;
|
import com.android.wm.shell.protolog.ShellProtoLogGroup;
|
||||||
@@ -62,7 +62,7 @@ public class TvPipBoundsAlgorithm extends PipBoundsAlgorithm {
|
|||||||
@NonNull TvPipBoundsState tvPipBoundsState,
|
@NonNull TvPipBoundsState tvPipBoundsState,
|
||||||
@NonNull PipSnapAlgorithm pipSnapAlgorithm) {
|
@NonNull PipSnapAlgorithm pipSnapAlgorithm) {
|
||||||
super(context, tvPipBoundsState, pipSnapAlgorithm,
|
super(context, tvPipBoundsState, pipSnapAlgorithm,
|
||||||
new PipKeepClearAlgorithm() {
|
new PipKeepClearAlgorithmInterface() {
|
||||||
});
|
});
|
||||||
this.mTvPipBoundsState = tvPipBoundsState;
|
this.mTvPipBoundsState = tvPipBoundsState;
|
||||||
this.mKeepClearAlgorithm = new TvPipKeepClearAlgorithm();
|
this.mKeepClearAlgorithm = new TvPipKeepClearAlgorithm();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class PipBoundsAlgorithmTest extends ShellTestCase {
|
|||||||
initializeMockResources();
|
initializeMockResources();
|
||||||
mPipBoundsState = new PipBoundsState(mContext);
|
mPipBoundsState = new PipBoundsState(mContext);
|
||||||
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState,
|
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState,
|
||||||
new PipSnapAlgorithm(), new PipKeepClearAlgorithm() {});
|
new PipSnapAlgorithm(), new PipKeepClearAlgorithmInterface() {});
|
||||||
|
|
||||||
mPipBoundsState.setDisplayLayout(
|
mPipBoundsState.setDisplayLayout(
|
||||||
new DisplayLayout(mDefaultDisplayInfo, mContext.getResources(), true, true));
|
new DisplayLayout(mDefaultDisplayInfo, mContext.getResources(), true, true));
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class PipTaskOrganizerTest extends ShellTestCase {
|
|||||||
mPipBoundsState = new PipBoundsState(mContext);
|
mPipBoundsState = new PipBoundsState(mContext);
|
||||||
mPipTransitionState = new PipTransitionState();
|
mPipTransitionState = new PipTransitionState();
|
||||||
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState,
|
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState,
|
||||||
new PipSnapAlgorithm(), new PipKeepClearAlgorithm() {});
|
new PipSnapAlgorithm(), new PipKeepClearAlgorithmInterface() {});
|
||||||
mMainExecutor = new TestShellExecutor();
|
mMainExecutor = new TestShellExecutor();
|
||||||
mPipTaskOrganizer = new PipTaskOrganizer(mContext,
|
mPipTaskOrganizer = new PipTaskOrganizer(mContext,
|
||||||
mMockSyncTransactionQueue, mPipTransitionState, mPipBoundsState,
|
mMockSyncTransactionQueue, mPipTransitionState, mPipBoundsState,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import com.android.wm.shell.common.FloatingContentCoordinator;
|
|||||||
import com.android.wm.shell.common.ShellExecutor;
|
import com.android.wm.shell.common.ShellExecutor;
|
||||||
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipBoundsState;
|
import com.android.wm.shell.pip.PipBoundsState;
|
||||||
import com.android.wm.shell.pip.PipKeepClearAlgorithm;
|
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
|
||||||
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipTaskOrganizer;
|
import com.android.wm.shell.pip.PipTaskOrganizer;
|
||||||
import com.android.wm.shell.pip.PipTransitionController;
|
import com.android.wm.shell.pip.PipTransitionController;
|
||||||
@@ -90,8 +90,8 @@ public class PipResizeGestureHandlerTest extends ShellTestCase {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mPipBoundsState = new PipBoundsState(mContext);
|
mPipBoundsState = new PipBoundsState(mContext);
|
||||||
final PipSnapAlgorithm pipSnapAlgorithm = new PipSnapAlgorithm();
|
final PipSnapAlgorithm pipSnapAlgorithm = new PipSnapAlgorithm();
|
||||||
final PipKeepClearAlgorithm pipKeepClearAlgorithm =
|
final PipKeepClearAlgorithmInterface pipKeepClearAlgorithm =
|
||||||
new PipKeepClearAlgorithm() {};
|
new PipKeepClearAlgorithmInterface() {};
|
||||||
final PipBoundsAlgorithm pipBoundsAlgorithm = new PipBoundsAlgorithm(mContext,
|
final PipBoundsAlgorithm pipBoundsAlgorithm = new PipBoundsAlgorithm(mContext,
|
||||||
mPipBoundsState, pipSnapAlgorithm, pipKeepClearAlgorithm);
|
mPipBoundsState, pipSnapAlgorithm, pipKeepClearAlgorithm);
|
||||||
final PipMotionHelper motionHelper = new PipMotionHelper(mContext, mPipBoundsState,
|
final PipMotionHelper motionHelper = new PipMotionHelper(mContext, mPipBoundsState,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.android.wm.shell.common.FloatingContentCoordinator;
|
|||||||
import com.android.wm.shell.common.ShellExecutor;
|
import com.android.wm.shell.common.ShellExecutor;
|
||||||
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
import com.android.wm.shell.pip.PipBoundsAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipBoundsState;
|
import com.android.wm.shell.pip.PipBoundsState;
|
||||||
import com.android.wm.shell.pip.PipKeepClearAlgorithm;
|
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
|
||||||
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
import com.android.wm.shell.pip.PipSnapAlgorithm;
|
||||||
import com.android.wm.shell.pip.PipTaskOrganizer;
|
import com.android.wm.shell.pip.PipTaskOrganizer;
|
||||||
import com.android.wm.shell.pip.PipTransitionController;
|
import com.android.wm.shell.pip.PipTransitionController;
|
||||||
@@ -106,7 +106,7 @@ public class PipTouchHandlerTest extends ShellTestCase {
|
|||||||
mPipBoundsState = new PipBoundsState(mContext);
|
mPipBoundsState = new PipBoundsState(mContext);
|
||||||
mPipSnapAlgorithm = new PipSnapAlgorithm();
|
mPipSnapAlgorithm = new PipSnapAlgorithm();
|
||||||
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState, mPipSnapAlgorithm,
|
mPipBoundsAlgorithm = new PipBoundsAlgorithm(mContext, mPipBoundsState, mPipSnapAlgorithm,
|
||||||
new PipKeepClearAlgorithm() {});
|
new PipKeepClearAlgorithmInterface() {});
|
||||||
PipMotionHelper pipMotionHelper = new PipMotionHelper(mContext, mPipBoundsState,
|
PipMotionHelper pipMotionHelper = new PipMotionHelper(mContext, mPipBoundsState,
|
||||||
mPipTaskOrganizer, mPhonePipMenuController, mPipSnapAlgorithm,
|
mPipTaskOrganizer, mPhonePipMenuController, mPipSnapAlgorithm,
|
||||||
mMockPipTransitionController, mFloatingContentCoordinator);
|
mMockPipTransitionController, mFloatingContentCoordinator);
|
||||||
|
|||||||
Reference in New Issue
Block a user