Merge "Update APP_TRANSITION_STATE for Shell transition"
This commit is contained in:
@@ -1328,7 +1328,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
||||
}
|
||||
|
||||
boolean getLegacyIsReady() {
|
||||
return mState == STATE_STARTED && mSyncId >= 0 && mSyncEngine.isReady(mSyncId);
|
||||
return (mState == STATE_STARTED || mState == STATE_COLLECTING) && mSyncId >= 0;
|
||||
}
|
||||
|
||||
static Transition fromBinder(IBinder binder) {
|
||||
|
||||
@@ -94,6 +94,9 @@ class TransitionController {
|
||||
// TODO(b/188595497): remove when not needed.
|
||||
final StatusBarManagerInternal mStatusBar;
|
||||
|
||||
/** Pending transitions from Shell that are waiting the SyncEngine to be free. */
|
||||
private final ArrayList<PendingStartTransition> mPendingTransitions = new ArrayList<>();
|
||||
|
||||
TransitionController(ActivityTaskManagerService atm,
|
||||
TaskSnapshotController taskSnapshotController) {
|
||||
mAtm = atm;
|
||||
@@ -160,9 +163,11 @@ class TransitionController {
|
||||
}
|
||||
final PendingStartTransition out = new PendingStartTransition(new Transition(type,
|
||||
0 /* flags */, this, mAtm.mWindowManager.mSyncEngine));
|
||||
mPendingTransitions.add(out);
|
||||
// We want to start collecting immediately when the engine is free, otherwise it may
|
||||
// be busy again.
|
||||
out.setStartSync(() -> {
|
||||
mPendingTransitions.remove(out);
|
||||
moveToCollecting(out.mTransition);
|
||||
});
|
||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Creating PendingTransition: %s",
|
||||
@@ -530,7 +535,10 @@ class TransitionController {
|
||||
int state = LEGACY_STATE_IDLE;
|
||||
if (!mPlayingTransitions.isEmpty()) {
|
||||
state = LEGACY_STATE_RUNNING;
|
||||
} else if (mCollectingTransition != null && mCollectingTransition.getLegacyIsReady()) {
|
||||
} else if ((mCollectingTransition != null && mCollectingTransition.getLegacyIsReady())
|
||||
|| !mPendingTransitions.isEmpty()) {
|
||||
// The transition may not be "ready", but we have transition waiting to start, so it
|
||||
// can't be IDLE for test purpose. Ideally, we should have a STATE_COLLECTING.
|
||||
state = LEGACY_STATE_READY;
|
||||
}
|
||||
proto.write(AppTransitionProto.APP_TRANSITION_STATE, state);
|
||||
|
||||
Reference in New Issue
Block a user