Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipDisplayTransferHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.Trace; import android.util.ArrayMap; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; Loading Loading @@ -153,6 +154,9 @@ public class PipDisplayTransferHandler implements final Rect pipBounds = extra.getParcelable( PIP_DESTINATION_BOUNDS, Rect.class); Trace.instant(Trace.TRACE_TAG_WINDOW_MANAGER, "PipDisplayTransferHandler#changingPipBounds"); mPipDisplayLayoutState.setDisplayId(mTargetDisplayId); mPipDisplayLayoutState.setDisplayLayout( mDisplayController.getDisplayLayout(mTargetDisplayId)); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipScheduler.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.os.SystemProperties; import android.os.Trace; import android.view.SurfaceControl; import android.window.DisplayAreaInfo; import android.window.WindowContainerToken; Loading Loading @@ -241,6 +242,8 @@ public class PipScheduler implements PipTransitionState.PipTransitionStateChange * @param targetDisplayId the target display ID where the PiP window should be parented to. */ public void scheduleMoveToDisplay(int targetDisplayId, Rect pipBounds) { Trace.instant(Trace.TRACE_TAG_WINDOW_MANAGER, "PipScheduler#scheduleMoveToDisplay: " + targetDisplayId); WindowContainerToken pipTaskToken = mPipTransitionState.getPipTaskToken(); DisplayAreaInfo displayAreaInfo = mPipDesktopState.getRootTaskDisplayAreaOrganizer().getDisplayAreaInfo( Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java +9 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.SystemProperties; import android.os.Trace; import android.provider.DeviceConfig; import android.util.Size; import android.view.DisplayCutout; Loading Loading @@ -74,6 +75,7 @@ import com.android.wm.shell.sysui.ShellInit; import java.io.PrintWriter; import java.util.Optional; import java.util.Random; /** * Manages all the touch handling for PIP on the Phone, including moving, dismissing and expanding Loading Loading @@ -145,6 +147,9 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha // Temp vars private final Rect mTmpBounds = new Rect(); // Random int for tracking trace begin and end private int mUniqueCookie; // Callbacks private final Runnable mMoveOnShelVisibilityChanged; Loading Loading @@ -266,6 +271,8 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha if (PipFlags.isPip2ExperimentEnabled()) { shellInit.addInitCallback(this::onInit, this); } mUniqueCookie = new Random().nextInt(); } /** Loading Loading @@ -587,6 +594,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: { Trace.beginAsyncSection("PipTouchHandler#onDown", mUniqueCookie); mGesture.onDown(mTouchState); break; } Loading @@ -602,7 +610,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha // Update the movement bounds again if the state has changed since the user started // dragging (ie. when the IME shows) updateMovementBounds(); Trace.endAsyncSection("PipTouchHandler#onDown", mUniqueCookie); if (mGesture.onUp(mTouchState)) { break; } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipDisplayTransferHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.Trace; import android.util.ArrayMap; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; Loading Loading @@ -153,6 +154,9 @@ public class PipDisplayTransferHandler implements final Rect pipBounds = extra.getParcelable( PIP_DESTINATION_BOUNDS, Rect.class); Trace.instant(Trace.TRACE_TAG_WINDOW_MANAGER, "PipDisplayTransferHandler#changingPipBounds"); mPipDisplayLayoutState.setDisplayId(mTargetDisplayId); mPipDisplayLayoutState.setDisplayLayout( mDisplayController.getDisplayLayout(mTargetDisplayId)); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipScheduler.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.os.SystemProperties; import android.os.Trace; import android.view.SurfaceControl; import android.window.DisplayAreaInfo; import android.window.WindowContainerToken; Loading Loading @@ -241,6 +242,8 @@ public class PipScheduler implements PipTransitionState.PipTransitionStateChange * @param targetDisplayId the target display ID where the PiP window should be parented to. */ public void scheduleMoveToDisplay(int targetDisplayId, Rect pipBounds) { Trace.instant(Trace.TRACE_TAG_WINDOW_MANAGER, "PipScheduler#scheduleMoveToDisplay: " + targetDisplayId); WindowContainerToken pipTaskToken = mPipTransitionState.getPipTaskToken(); DisplayAreaInfo displayAreaInfo = mPipDesktopState.getRootTaskDisplayAreaOrganizer().getDisplayAreaInfo( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java +9 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.SystemProperties; import android.os.Trace; import android.provider.DeviceConfig; import android.util.Size; import android.view.DisplayCutout; Loading Loading @@ -74,6 +75,7 @@ import com.android.wm.shell.sysui.ShellInit; import java.io.PrintWriter; import java.util.Optional; import java.util.Random; /** * Manages all the touch handling for PIP on the Phone, including moving, dismissing and expanding Loading Loading @@ -145,6 +147,9 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha // Temp vars private final Rect mTmpBounds = new Rect(); // Random int for tracking trace begin and end private int mUniqueCookie; // Callbacks private final Runnable mMoveOnShelVisibilityChanged; Loading Loading @@ -266,6 +271,8 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha if (PipFlags.isPip2ExperimentEnabled()) { shellInit.addInitCallback(this::onInit, this); } mUniqueCookie = new Random().nextInt(); } /** Loading Loading @@ -587,6 +594,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: { Trace.beginAsyncSection("PipTouchHandler#onDown", mUniqueCookie); mGesture.onDown(mTouchState); break; } Loading @@ -602,7 +610,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha // Update the movement bounds again if the state has changed since the user started // dragging (ie. when the IME shows) updateMovementBounds(); Trace.endAsyncSection("PipTouchHandler#onDown", mUniqueCookie); if (mGesture.onUp(mTouchState)) { break; } Loading