Merge "Skip enter split expanding animation by drag" into tm-qpr-dev
This commit is contained in:
@@ -87,6 +87,10 @@ public class SplitscreenEventLogger {
|
|||||||
return mLoggerSessionId != null;
|
return mLoggerSessionId != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnterRequestedByDrag() {
|
||||||
|
return mEnterReason == ENTER_REASON_DRAG;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* May be called before logEnter() to indicate that the session was started from a drag.
|
* May be called before logEnter() to indicate that the session was started from a drag.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -505,6 +505,12 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
options = resolveStartStage(STAGE_TYPE_UNDEFINED, position, options, wct);
|
options = resolveStartStage(STAGE_TYPE_UNDEFINED, position, options, wct);
|
||||||
|
|
||||||
|
// If split still not active, apply windows bounds first to avoid surface reset to
|
||||||
|
// wrong pos by SurfaceAnimator from wms.
|
||||||
|
if (!mMainStage.isActive() && mLogger.isEnterRequestedByDrag()) {
|
||||||
|
updateWindowBounds(mSplitLayout, wct);
|
||||||
|
}
|
||||||
|
|
||||||
wct.sendPendingIntent(intent, fillInIntent, options);
|
wct.sendPendingIntent(intent, fillInIntent, options);
|
||||||
mSyncQueue.queue(transition, WindowManager.TRANSIT_OPEN, wct);
|
mSyncQueue.queue(transition, WindowManager.TRANSIT_OPEN, wct);
|
||||||
}
|
}
|
||||||
@@ -1461,18 +1467,27 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (isSideStage && hasChildren && !mMainStage.isActive()) {
|
} else if (isSideStage && hasChildren && !mMainStage.isActive()) {
|
||||||
// TODO (b/238697912) : Add the validation to prevent entering non-recovered status
|
|
||||||
onSplitScreenEnter();
|
|
||||||
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
mSplitLayout.init();
|
mSplitLayout.init();
|
||||||
|
if (mLogger.isEnterRequestedByDrag()) {
|
||||||
|
prepareEnterSplitScreen(wct);
|
||||||
|
} else {
|
||||||
|
// TODO (b/238697912) : Add the validation to prevent entering non-recovered status
|
||||||
|
onSplitScreenEnter();
|
||||||
mSplitLayout.setDividerAtBorder(mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT);
|
mSplitLayout.setDividerAtBorder(mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT);
|
||||||
mMainStage.activate(wct, true /* includingTopTask */);
|
mMainStage.activate(wct, true /* includingTopTask */);
|
||||||
updateWindowBounds(mSplitLayout, wct);
|
updateWindowBounds(mSplitLayout, wct);
|
||||||
wct.reorder(mRootTaskInfo.token, true);
|
wct.reorder(mRootTaskInfo.token, true);
|
||||||
wct.setForceTranslucent(mRootTaskInfo.token, false);
|
wct.setForceTranslucent(mRootTaskInfo.token, false);
|
||||||
|
}
|
||||||
|
|
||||||
mSyncQueue.queue(wct);
|
mSyncQueue.queue(wct);
|
||||||
mSyncQueue.runInSync(t -> {
|
mSyncQueue.runInSync(t -> {
|
||||||
|
if (mLogger.isEnterRequestedByDrag()) {
|
||||||
|
updateSurfaceBounds(mSplitLayout, t, false /* applyResizingOffset */);
|
||||||
|
} else {
|
||||||
mSplitLayout.flingDividerToCenter();
|
mSplitLayout.flingDividerToCenter();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (mMainStageListener.mHasChildren && mSideStageListener.mHasChildren) {
|
if (mMainStageListener.mHasChildren && mSideStageListener.mHasChildren) {
|
||||||
|
|||||||
Reference in New Issue
Block a user