Update transient-flags when windows are collected
Originally, we assumed all relevant windows were already collected at the time `setTransientLaunch` was called. However, if a non-deferrable transition comes in, it will be collected into the same transition so we need to check any new additions as well. Otherwise, they can be mis-classified as non-changing. Bug: 281791274 Test: open settings, show brightness-slider, swipe-to-home Change-Id: I43c5f046e394a26fd389c004c474dcbde24d2d89
This commit is contained in:
@@ -382,11 +382,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
||||
// Add FLAG_ABOVE_TRANSIENT_LAUNCH to the tree of transient-hide tasks,
|
||||
// so ChangeInfo#hasChanged() can return true to report the transition info.
|
||||
for (int i = mChanges.size() - 1; i >= 0; --i) {
|
||||
final WindowContainer<?> wc = mChanges.keyAt(i);
|
||||
if (wc.asTaskFragment() == null && wc.asActivityRecord() == null) continue;
|
||||
if (isInTransientHide(wc)) {
|
||||
mChanges.valueAt(i).mFlags |= ChangeInfo.FLAG_ABOVE_TRANSIENT_LAUNCH;
|
||||
}
|
||||
updateTransientFlags(mChanges.valueAt(i));
|
||||
}
|
||||
}
|
||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Transition %d: Set %s as "
|
||||
@@ -581,7 +577,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
||||
for (WindowContainer<?> curr = getAnimatableParent(wc);
|
||||
curr != null && !mChanges.containsKey(curr);
|
||||
curr = getAnimatableParent(curr)) {
|
||||
mChanges.put(curr, new ChangeInfo(curr));
|
||||
final ChangeInfo info = new ChangeInfo(curr);
|
||||
updateTransientFlags(info);
|
||||
mChanges.put(curr, info);
|
||||
if (isReadyGroup(curr)) {
|
||||
mReadyTracker.addGroup(curr);
|
||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, " Creating Ready-group for"
|
||||
@@ -600,6 +598,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
||||
ChangeInfo info = mChanges.get(wc);
|
||||
if (info == null) {
|
||||
info = new ChangeInfo(wc);
|
||||
updateTransientFlags(info);
|
||||
mChanges.put(wc, info);
|
||||
}
|
||||
mParticipants.add(wc);
|
||||
@@ -615,6 +614,14 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTransientFlags(@NonNull ChangeInfo info) {
|
||||
final WindowContainer<?> wc = info.mContainer;
|
||||
// Only look at tasks, taskfragments, or activities
|
||||
if (wc.asTaskFragment() == null && wc.asActivityRecord() == null) return;
|
||||
if (!isInTransientHide(wc)) return;
|
||||
info.mFlags |= ChangeInfo.FLAG_ABOVE_TRANSIENT_LAUNCH;
|
||||
}
|
||||
|
||||
private void recordDisplay(DisplayContent dc) {
|
||||
if (dc == null || mTargetDisplays.contains(dc)) return;
|
||||
mTargetDisplays.add(dc);
|
||||
|
||||
Reference in New Issue
Block a user