Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +34 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import android.content.res.Configuration; import android.graphics.Rect; import android.os.RemoteException; import android.os.SystemProperties; import android.util.Rational; import android.view.Choreographer; import android.view.Display; import android.view.Surface; Loading Loading @@ -126,6 +127,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, SystemProperties.getInt( "persist.wm.debug.extra_content_overlay_fade_out_delay_ms", 400); private static final float PIP_ASPECT_RATIO_MISMATCH_THRESHOLD = 0.005f; private final Context mContext; private final SyncTransactionQueue mSyncTransactionQueue; private final PipBoundsState mPipBoundsState; Loading Loading @@ -767,6 +770,37 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, mPictureInPictureParams.getTitle()); mPipParamsChangedForwarder.notifySubtitleChanged( mPictureInPictureParams.getSubtitle()); if (mPictureInPictureParams.hasSourceBoundsHint() && mPictureInPictureParams.hasSetAspectRatio()) { Rational sourceRectHintAspectRatio = new Rational( mPictureInPictureParams.getSourceRectHint().width(), mPictureInPictureParams.getSourceRectHint().height()); if (sourceRectHintAspectRatio.compareTo( mPictureInPictureParams.getAspectRatio()) != 0) { ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "Aspect ratio of source rect hint (%d/%d) does not match the provided " + "aspect ratio value (%d/%d). Consider matching them for " + "improved animation. Future releases might override the " + "value to match.", mPictureInPictureParams.getSourceRectHint().width(), mPictureInPictureParams.getSourceRectHint().height(), mPictureInPictureParams.getAspectRatio().getNumerator(), mPictureInPictureParams.getAspectRatio().getDenominator()); } if (Math.abs(sourceRectHintAspectRatio.floatValue() - mPictureInPictureParams.getAspectRatioFloat()) > PIP_ASPECT_RATIO_MISMATCH_THRESHOLD) { ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "Aspect ratio of source rect hint (%f) does not match the provided " + "aspect ratio value (%f) and is above threshold of %f. " + "Consider matching them for improved animation. Future " + "releases might override the value to match.", sourceRectHintAspectRatio.floatValue(), mPictureInPictureParams.getAspectRatioFloat(), PIP_ASPECT_RATIO_MISMATCH_THRESHOLD); } } } mPipUiEventLoggerLogger.setTaskInfo(mTaskInfo); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +34 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import android.content.res.Configuration; import android.graphics.Rect; import android.os.RemoteException; import android.os.SystemProperties; import android.util.Rational; import android.view.Choreographer; import android.view.Display; import android.view.Surface; Loading Loading @@ -126,6 +127,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, SystemProperties.getInt( "persist.wm.debug.extra_content_overlay_fade_out_delay_ms", 400); private static final float PIP_ASPECT_RATIO_MISMATCH_THRESHOLD = 0.005f; private final Context mContext; private final SyncTransactionQueue mSyncTransactionQueue; private final PipBoundsState mPipBoundsState; Loading Loading @@ -767,6 +770,37 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, mPictureInPictureParams.getTitle()); mPipParamsChangedForwarder.notifySubtitleChanged( mPictureInPictureParams.getSubtitle()); if (mPictureInPictureParams.hasSourceBoundsHint() && mPictureInPictureParams.hasSetAspectRatio()) { Rational sourceRectHintAspectRatio = new Rational( mPictureInPictureParams.getSourceRectHint().width(), mPictureInPictureParams.getSourceRectHint().height()); if (sourceRectHintAspectRatio.compareTo( mPictureInPictureParams.getAspectRatio()) != 0) { ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "Aspect ratio of source rect hint (%d/%d) does not match the provided " + "aspect ratio value (%d/%d). Consider matching them for " + "improved animation. Future releases might override the " + "value to match.", mPictureInPictureParams.getSourceRectHint().width(), mPictureInPictureParams.getSourceRectHint().height(), mPictureInPictureParams.getAspectRatio().getNumerator(), mPictureInPictureParams.getAspectRatio().getDenominator()); } if (Math.abs(sourceRectHintAspectRatio.floatValue() - mPictureInPictureParams.getAspectRatioFloat()) > PIP_ASPECT_RATIO_MISMATCH_THRESHOLD) { ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "Aspect ratio of source rect hint (%f) does not match the provided " + "aspect ratio value (%f) and is above threshold of %f. " + "Consider matching them for improved animation. Future " + "releases might override the value to match.", sourceRectHintAspectRatio.floatValue(), mPictureInPictureParams.getAspectRatioFloat(), PIP_ASPECT_RATIO_MISMATCH_THRESHOLD); } } } mPipUiEventLoggerLogger.setTaskInfo(mTaskInfo); Loading