Loading packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -468,6 +468,9 @@ <!-- On debuggable builds, alert the user if SystemUI PSS goes over this number (in kb) --> <integer name="watch_heap_limit">256000</integer> <!-- Animation duration for resizing of PIP when entering/exiting. --> <integer name="config_pipResizeAnimationDuration">425</integer> <!-- Allow dragging the PIP to a location to close it --> <bool name="config_pipEnableDismissDragToEdge">true</bool> Loading packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java +0 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ public class PipAnimationController { private static final float FRACTION_START = 0f; private static final float FRACTION_END = 1f; public static final int DURATION_DEFAULT_MS = 425; public static final int ANIM_TYPE_BOUNDS = 0; public static final int ANIM_TYPE_ALPHA = 1; Loading packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +7 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.pip; import static com.android.systemui.pip.PipAnimationController.ANIM_TYPE_ALPHA; import static com.android.systemui.pip.PipAnimationController.ANIM_TYPE_BOUNDS; import static com.android.systemui.pip.PipAnimationController.DURATION_DEFAULT_MS; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_NONE; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_SAME; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_TO_FULLSCREEN; Loading Loading @@ -81,6 +80,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { private final Rect mLastReportedBounds = new Rect(); private final int mCornerRadius; private final Map<IBinder, Rect> mBoundsToRestore = new HashMap<>(); private final int mEnterExitAnimationDuration; // These callbacks are called on the update thread private final PipAnimationController.PipAnimationCallback mPipAnimationCallback = Loading Loading @@ -180,6 +180,8 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { mPipBoundsHandler = boundsHandler; mPipAnimationController = new PipAnimationController(context); mCornerRadius = context.getResources().getDimensionPixelSize(R.dimen.pip_corner_radius); mEnterExitAnimationDuration = context.getResources() .getInteger(R.integer.config_pipResizeAnimationDuration); } public Handler getUpdateHandler() { Loading Loading @@ -235,14 +237,14 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { mBoundsToRestore.put(mToken.asBinder(), currentBounds); if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { scheduleAnimateResizePip(currentBounds, destinationBounds, TRANSITION_DIRECTION_TO_PIP, DURATION_DEFAULT_MS, null); TRANSITION_DIRECTION_TO_PIP, mEnterExitAnimationDuration, null); } else if (mOneShotAnimationType == ANIM_TYPE_ALPHA) { mUpdateHandler.post(() -> mPipAnimationController .getAnimator(mLeash, destinationBounds, 0f, 1f) .setTransitionDirection(TRANSITION_DIRECTION_TO_PIP) .setCornerRadius(mCornerRadius) .setPipAnimationCallback(mPipAnimationCallback) .setDuration(DURATION_DEFAULT_MS) .setDuration(mEnterExitAnimationDuration) .start()); mOneShotAnimationType = ANIM_TYPE_BOUNDS; } else { Loading @@ -260,7 +262,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { } final Rect boundsToRestore = mBoundsToRestore.remove(mToken.asBinder()); scheduleAnimateResizePip(mLastReportedBounds, boundsToRestore, TRANSITION_DIRECTION_TO_FULLSCREEN, DURATION_DEFAULT_MS, null); TRANSITION_DIRECTION_TO_FULLSCREEN, mEnterExitAnimationDuration, null); mInPip = false; } Loading @@ -278,7 +280,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { final Rect destinationBounds = mPipBoundsHandler.getDestinationBounds( getAspectRatioOrDefault(newParams), null /* bounds */); Objects.requireNonNull(destinationBounds, "Missing destination bounds"); scheduleAnimateResizePip(destinationBounds, DURATION_DEFAULT_MS, null); scheduleAnimateResizePip(destinationBounds, mEnterExitAnimationDuration, null); } /** Loading packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java +5 −3 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ import static android.app.ActivityTaskManager.INVALID_STACK_ID; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static com.android.systemui.pip.PipAnimationController.DURATION_DEFAULT_MS; import android.app.ActivityManager.RunningTaskInfo; import android.app.ActivityManager.StackInfo; import android.app.ActivityTaskManager; Loading Loading @@ -136,6 +134,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio private String[] mLastPackagesResourceGranted; private PipNotification mPipNotification; private ParceledListSlice mCustomActions; private int mResizeAnimationDuration; // Used to calculate the movement bounds private final DisplayInfo mTmpDisplayInfo = new DisplayInfo(); Loading Loading @@ -238,6 +237,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mInitialized = true; mContext = context; mPipBoundsHandler = pipBoundsHandler; mResizeAnimationDuration = context.getResources() .getInteger(R.integer.config_pipResizeAnimationDuration); mPipTaskOrganizer = new PipTaskOrganizer(mContext, mPipBoundsHandler); mPipTaskOrganizer.registerPipTransitionCallback(this); mActivityTaskManager = ActivityTaskManager.getService(); Loading Loading @@ -436,7 +437,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mCurrentPipBounds = mPipBounds; break; } mPipTaskOrganizer.scheduleAnimateResizePip(mCurrentPipBounds, DURATION_DEFAULT_MS, null); mPipTaskOrganizer.scheduleAnimateResizePip(mCurrentPipBounds, mResizeAnimationDuration, null); } /** Loading Loading
packages/SystemUI/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -468,6 +468,9 @@ <!-- On debuggable builds, alert the user if SystemUI PSS goes over this number (in kb) --> <integer name="watch_heap_limit">256000</integer> <!-- Animation duration for resizing of PIP when entering/exiting. --> <integer name="config_pipResizeAnimationDuration">425</integer> <!-- Allow dragging the PIP to a location to close it --> <bool name="config_pipEnableDismissDragToEdge">true</bool> Loading
packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java +0 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ public class PipAnimationController { private static final float FRACTION_START = 0f; private static final float FRACTION_END = 1f; public static final int DURATION_DEFAULT_MS = 425; public static final int ANIM_TYPE_BOUNDS = 0; public static final int ANIM_TYPE_ALPHA = 1; Loading
packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +7 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.pip; import static com.android.systemui.pip.PipAnimationController.ANIM_TYPE_ALPHA; import static com.android.systemui.pip.PipAnimationController.ANIM_TYPE_BOUNDS; import static com.android.systemui.pip.PipAnimationController.DURATION_DEFAULT_MS; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_NONE; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_SAME; import static com.android.systemui.pip.PipAnimationController.TRANSITION_DIRECTION_TO_FULLSCREEN; Loading Loading @@ -81,6 +80,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { private final Rect mLastReportedBounds = new Rect(); private final int mCornerRadius; private final Map<IBinder, Rect> mBoundsToRestore = new HashMap<>(); private final int mEnterExitAnimationDuration; // These callbacks are called on the update thread private final PipAnimationController.PipAnimationCallback mPipAnimationCallback = Loading Loading @@ -180,6 +180,8 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { mPipBoundsHandler = boundsHandler; mPipAnimationController = new PipAnimationController(context); mCornerRadius = context.getResources().getDimensionPixelSize(R.dimen.pip_corner_radius); mEnterExitAnimationDuration = context.getResources() .getInteger(R.integer.config_pipResizeAnimationDuration); } public Handler getUpdateHandler() { Loading Loading @@ -235,14 +237,14 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { mBoundsToRestore.put(mToken.asBinder(), currentBounds); if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) { scheduleAnimateResizePip(currentBounds, destinationBounds, TRANSITION_DIRECTION_TO_PIP, DURATION_DEFAULT_MS, null); TRANSITION_DIRECTION_TO_PIP, mEnterExitAnimationDuration, null); } else if (mOneShotAnimationType == ANIM_TYPE_ALPHA) { mUpdateHandler.post(() -> mPipAnimationController .getAnimator(mLeash, destinationBounds, 0f, 1f) .setTransitionDirection(TRANSITION_DIRECTION_TO_PIP) .setCornerRadius(mCornerRadius) .setPipAnimationCallback(mPipAnimationCallback) .setDuration(DURATION_DEFAULT_MS) .setDuration(mEnterExitAnimationDuration) .start()); mOneShotAnimationType = ANIM_TYPE_BOUNDS; } else { Loading @@ -260,7 +262,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { } final Rect boundsToRestore = mBoundsToRestore.remove(mToken.asBinder()); scheduleAnimateResizePip(mLastReportedBounds, boundsToRestore, TRANSITION_DIRECTION_TO_FULLSCREEN, DURATION_DEFAULT_MS, null); TRANSITION_DIRECTION_TO_FULLSCREEN, mEnterExitAnimationDuration, null); mInPip = false; } Loading @@ -278,7 +280,7 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub { final Rect destinationBounds = mPipBoundsHandler.getDestinationBounds( getAspectRatioOrDefault(newParams), null /* bounds */); Objects.requireNonNull(destinationBounds, "Missing destination bounds"); scheduleAnimateResizePip(destinationBounds, DURATION_DEFAULT_MS, null); scheduleAnimateResizePip(destinationBounds, mEnterExitAnimationDuration, null); } /** Loading
packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java +5 −3 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ import static android.app.ActivityTaskManager.INVALID_STACK_ID; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static com.android.systemui.pip.PipAnimationController.DURATION_DEFAULT_MS; import android.app.ActivityManager.RunningTaskInfo; import android.app.ActivityManager.StackInfo; import android.app.ActivityTaskManager; Loading Loading @@ -136,6 +134,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio private String[] mLastPackagesResourceGranted; private PipNotification mPipNotification; private ParceledListSlice mCustomActions; private int mResizeAnimationDuration; // Used to calculate the movement bounds private final DisplayInfo mTmpDisplayInfo = new DisplayInfo(); Loading Loading @@ -238,6 +237,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mInitialized = true; mContext = context; mPipBoundsHandler = pipBoundsHandler; mResizeAnimationDuration = context.getResources() .getInteger(R.integer.config_pipResizeAnimationDuration); mPipTaskOrganizer = new PipTaskOrganizer(mContext, mPipBoundsHandler); mPipTaskOrganizer.registerPipTransitionCallback(this); mActivityTaskManager = ActivityTaskManager.getService(); Loading Loading @@ -436,7 +437,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio mCurrentPipBounds = mPipBounds; break; } mPipTaskOrganizer.scheduleAnimateResizePip(mCurrentPipBounds, DURATION_DEFAULT_MS, null); mPipTaskOrganizer.scheduleAnimateResizePip(mCurrentPipBounds, mResizeAnimationDuration, null); } /** Loading