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 boolean mShouldDisableCanAffectSystemUiFlags;
|
||||
|
||||
private PictureInPictureSurfaceTransaction(Parcel in) {
|
||||
mAlpha = in.readFloat();
|
||||
mPosition = in.readTypedObject(PointF.CREATOR);
|
||||
@@ -60,6 +62,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
mCornerRadius = in.readFloat();
|
||||
mShadowRadius = in.readFloat();
|
||||
mWindowCrop = in.readTypedObject(Rect.CREATOR);
|
||||
mShouldDisableCanAffectSystemUiFlags = in.readBoolean();
|
||||
}
|
||||
|
||||
private PictureInPictureSurfaceTransaction(float alpha, @Nullable PointF position,
|
||||
@@ -84,6 +87,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
this(other.mAlpha, other.mPosition,
|
||||
other.mFloat9, other.mRotation, other.mCornerRadius, other.mShadowRadius,
|
||||
other.mWindowCrop);
|
||||
mShouldDisableCanAffectSystemUiFlags = other.mShouldDisableCanAffectSystemUiFlags;
|
||||
}
|
||||
|
||||
/** @return {@link Matrix} from {@link #mFloat9} */
|
||||
@@ -103,6 +107,16 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -114,13 +128,16 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
&& Objects.equals(mRotation, that.mRotation)
|
||||
&& Objects.equals(mCornerRadius, that.mCornerRadius)
|
||||
&& Objects.equals(mShadowRadius, that.mShadowRadius)
|
||||
&& Objects.equals(mWindowCrop, that.mWindowCrop);
|
||||
&& Objects.equals(mWindowCrop, that.mWindowCrop)
|
||||
&& mShouldDisableCanAffectSystemUiFlags
|
||||
== that.mShouldDisableCanAffectSystemUiFlags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mAlpha, mPosition, Arrays.hashCode(mFloat9),
|
||||
mRotation, mCornerRadius, mShadowRadius, mWindowCrop);
|
||||
mRotation, mCornerRadius, mShadowRadius, mWindowCrop,
|
||||
mShouldDisableCanAffectSystemUiFlags);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,6 +154,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
out.writeFloat(mCornerRadius);
|
||||
out.writeFloat(mShadowRadius);
|
||||
out.writeTypedObject(mWindowCrop, 0 /* flags */);
|
||||
out.writeBoolean(mShouldDisableCanAffectSystemUiFlags);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,6 +168,7 @@ public final class PictureInPictureSurfaceTransaction implements Parcelable {
|
||||
+ " cornerRadius=" + mCornerRadius
|
||||
+ " shadowRadius=" + mShadowRadius
|
||||
+ " crop=" + mWindowCrop
|
||||
+ " shouldDisableCanAffectSystemUiFlags" + mShouldDisableCanAffectSystemUiFlags
|
||||
+ ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -1335,16 +1335,16 @@ public class RecentsAnimationController implements DeathRecipient {
|
||||
mDisplayContent.mPinnedTaskController.setEnterPipTransaction(
|
||||
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;
|
||||
mFinishOverlay = null;
|
||||
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()) {
|
||||
// Apply the task's pending transaction in case it is detached and its transaction
|
||||
// is not reachable.
|
||||
|
||||
Reference in New Issue
Block a user