Merge "[DO NOT MERGE] Disable live tile in split mode for S" into sc-dev

This commit is contained in:
Tracy Zhou 2021-08-03 21:50:06 +00:00 committed by Android (Google) Code Review
commit 25399db1e7
2 changed files with 17 additions and 2 deletions

View File

@ -56,6 +56,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
private final Context mContext;
private final BaseActivityInterface mSizeStrategy;
private final boolean mIsForLiveTile;
@NonNull
private RecentsOrientedState mOrientationState;
@ -93,8 +94,14 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
private int mOrientationStateId;
public TaskViewSimulator(Context context, BaseActivityInterface sizeStrategy) {
this(context, sizeStrategy, false);
}
public TaskViewSimulator(Context context, BaseActivityInterface sizeStrategy,
boolean isForLiveTile) {
mContext = context;
mSizeStrategy = sizeStrategy;
mIsForLiveTile = isForLiveTile;
// TODO(b/187074722): Don't create this per-TaskViewSimulator
mOrientationState = TraceHelper.allowIpcs("",
@ -302,7 +309,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
.withWindowCrop(mTmpCropRect)
.withCornerRadius(getCurrentCornerRadius());
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && params.getRecentsSurface() != null) {
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mIsForLiveTile
&& params.getRecentsSurface() != null) {
// When relativeLayer = 0, it reverts the surfaces back to the original order.
builder.withRelativeLayerTo(params.getRecentsSurface(),
mDrawsBelowRecents ? Integer.MIN_VALUE : 0);

View File

@ -629,7 +629,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
// Initialize quickstep specific cache params here, as this is constructed only once
mActivity.getViewCache().setCacheSize(R.layout.digital_wellbeing_toast, 5);
mLiveTileTaskViewSimulator = new TaskViewSimulator(getContext(), getSizeStrategy());
mLiveTileTaskViewSimulator = new TaskViewSimulator(getContext(), getSizeStrategy(),
true /* isForLiveTile */);
mLiveTileTaskViewSimulator.recentsViewScale.value = 1;
mLiveTileTaskViewSimulator.setOrientationState(mOrientationState);
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
@ -1791,6 +1792,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
}
mCurrentGestureEndTarget = null;
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mActivity.getDeviceProfile().isMultiWindowMode) {
switchToScreenshot(
() -> finishRecentsAnimation(true /* toRecents */, false /* shouldPip */,
null));
}
}
/**