Merge "Add flag to explicitly set setCanAffectSystemUiFlags" into tm-qpr-dev
This commit is contained in:
@@ -51,6 +51,8 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
|
|
||||||
private final Rect mWindowCrop;
|
private final Rect mWindowCrop;
|
||||||
|
|
||||||
|
private boolean mShouldDisableCanAffectSystemUiFlags;
|
||||||
|
|
||||||
private PictureInPictureSurfaceTransaction(Parcel in) {
|
private PictureInPictureSurfaceTransaction(Parcel in) {
|
||||||
mAlpha = in.readFloat();
|
mAlpha = in.readFloat();
|
||||||
mPosition = in.readTypedObject(PointF.CREATOR);
|
mPosition = in.readTypedObject(PointF.CREATOR);
|
||||||
@@ -60,6 +62,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
mCornerRadius = in.readFloat();
|
mCornerRadius = in.readFloat();
|
||||||
mShadowRadius = in.readFloat();
|
mShadowRadius = in.readFloat();
|
||||||
mWindowCrop = in.readTypedObject(Rect.CREATOR);
|
mWindowCrop = in.readTypedObject(Rect.CREATOR);
|
||||||
|
mShouldDisableCanAffectSystemUiFlags = in.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
private PictureInPictureSurfaceTransaction(float alpha, @Nullable PointF position,
|
private PictureInPictureSurfaceTransaction(float alpha, @Nullable PointF position,
|
||||||
@@ -84,6 +87,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
this(other.mAlpha, other.mPosition,
|
this(other.mAlpha, other.mPosition,
|
||||||
other.mFloat9, other.mRotation, other.mCornerRadius, other.mShadowRadius,
|
other.mFloat9, other.mRotation, other.mCornerRadius, other.mShadowRadius,
|
||||||
other.mWindowCrop);
|
other.mWindowCrop);
|
||||||
|
mShouldDisableCanAffectSystemUiFlags = other.mShouldDisableCanAffectSystemUiFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return {@link Matrix} from {@link #mFloat9} */
|
/** @return {@link Matrix} from {@link #mFloat9} */
|
||||||
@@ -103,6 +107,16 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
return mShadowRadius > 0;
|
return mShadowRadius > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Sets the internal {@link #mShouldDisableCanAffectSystemUiFlags}. */
|
||||||
|
public void setShouldDisableCanAffectSystemUiFlags(boolean shouldDisable) {
|
||||||
|
mShouldDisableCanAffectSystemUiFlags = shouldDisable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return {@code true} if we should disable Task#setCanAffectSystemUiFlags. */
|
||||||
|
public boolean getShouldDisableCanAffectSystemUiFlags() {
|
||||||
|
return mShouldDisableCanAffectSystemUiFlags;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
@@ -114,13 +128,16 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
&& Objects.equals(mRotation, that.mRotation)
|
&& Objects.equals(mRotation, that.mRotation)
|
||||||
&& Objects.equals(mCornerRadius, that.mCornerRadius)
|
&& Objects.equals(mCornerRadius, that.mCornerRadius)
|
||||||
&& Objects.equals(mShadowRadius, that.mShadowRadius)
|
&& Objects.equals(mShadowRadius, that.mShadowRadius)
|
||||||
&& Objects.equals(mWindowCrop, that.mWindowCrop);
|
&& Objects.equals(mWindowCrop, that.mWindowCrop)
|
||||||
|
&& mShouldDisableCanAffectSystemUiFlags
|
||||||
|
== that.mShouldDisableCanAffectSystemUiFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mAlpha, mPosition, Arrays.hashCode(mFloat9),
|
return Objects.hash(mAlpha, mPosition, Arrays.hashCode(mFloat9),
|
||||||
mRotation, mCornerRadius, mShadowRadius, mWindowCrop);
|
mRotation, mCornerRadius, mShadowRadius, mWindowCrop,
|
||||||
|
mShouldDisableCanAffectSystemUiFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -137,6 +154,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
out.writeFloat(mCornerRadius);
|
out.writeFloat(mCornerRadius);
|
||||||
out.writeFloat(mShadowRadius);
|
out.writeFloat(mShadowRadius);
|
||||||
out.writeTypedObject(mWindowCrop, 0 /* flags */);
|
out.writeTypedObject(mWindowCrop, 0 /* flags */);
|
||||||
|
out.writeBoolean(mShouldDisableCanAffectSystemUiFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -150,6 +168,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
|||||||
+ " cornerRadius=" + mCornerRadius
|
+ " cornerRadius=" + mCornerRadius
|
||||||
+ " shadowRadius=" + mShadowRadius
|
+ " shadowRadius=" + mShadowRadius
|
||||||
+ " crop=" + mWindowCrop
|
+ " crop=" + mWindowCrop
|
||||||
|
+ " shouldDisableCanAffectSystemUiFlags" + mShouldDisableCanAffectSystemUiFlags
|
||||||
+ ")";
|
+ ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1335,16 +1335,16 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
mDisplayContent.mPinnedTaskController.setEnterPipTransaction(
|
mDisplayContent.mPinnedTaskController.setEnterPipTransaction(
|
||||||
mFinishTransaction);
|
mFinishTransaction);
|
||||||
}
|
}
|
||||||
|
// In the case where we are transferring the transform to the task in preparation
|
||||||
|
// for entering PIP, we disable the task being able to affect sysui flags otherwise
|
||||||
|
// it may cause a flash
|
||||||
|
if (mTask.getActivityType() != mTargetActivityType
|
||||||
|
&& mFinishTransaction.getShouldDisableCanAffectSystemUiFlags()) {
|
||||||
|
mTask.setCanAffectSystemUiFlags(false);
|
||||||
|
}
|
||||||
mFinishTransaction = null;
|
mFinishTransaction = null;
|
||||||
mFinishOverlay = null;
|
mFinishOverlay = null;
|
||||||
pendingTransaction.apply();
|
pendingTransaction.apply();
|
||||||
|
|
||||||
// In the case where we are transferring the transform to the task in preparation
|
|
||||||
// for entering PIP, we disable the task being able to affect sysui flags otherwise
|
|
||||||
// it may cause a flash
|
|
||||||
if (mTask.getActivityType() != mTargetActivityType) {
|
|
||||||
mTask.setCanAffectSystemUiFlags(false);
|
|
||||||
}
|
|
||||||
} else if (!mTask.isAttached()) {
|
} else if (!mTask.isAttached()) {
|
||||||
// Apply the task's pending transaction in case it is detached and its transaction
|
// Apply the task's pending transaction in case it is detached and its transaction
|
||||||
// is not reachable.
|
// is not reachable.
|
||||||
|
|||||||
Reference in New Issue
Block a user