Merge "Fix a regression from miss detect cross-task target." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
09e278cbb7
@@ -883,6 +883,12 @@
|
|||||||
"group": "WM_SHOW_TRANSACTIONS",
|
"group": "WM_SHOW_TRANSACTIONS",
|
||||||
"at": "com\/android\/server\/wm\/WindowSurfaceController.java"
|
"at": "com\/android\/server\/wm\/WindowSurfaceController.java"
|
||||||
},
|
},
|
||||||
|
"-1258739769": {
|
||||||
|
"message": "onTransactionReady, opening: %s, closing: %s, animating: %s, match: %b",
|
||||||
|
"level": "DEBUG",
|
||||||
|
"group": "WM_DEBUG_BACK_PREVIEW",
|
||||||
|
"at": "com\/android\/server\/wm\/BackNavigationController.java"
|
||||||
|
},
|
||||||
"-1257821162": {
|
"-1257821162": {
|
||||||
"message": "OUT SURFACE %s: copied",
|
"message": "OUT SURFACE %s: copied",
|
||||||
"level": "INFO",
|
"level": "INFO",
|
||||||
|
|||||||
@@ -585,14 +585,14 @@ class BackNavigationController {
|
|||||||
* The closing target should only exist in close list, but the opening target can be either in
|
* The closing target should only exist in close list, but the opening target can be either in
|
||||||
* open or close list.
|
* open or close list.
|
||||||
*/
|
*/
|
||||||
void onTransactionReady(Transition transition) {
|
void onTransactionReady(Transition transition, ArrayList<Transition.ChangeInfo> targets) {
|
||||||
if (!isMonitoringTransition()) {
|
if (!isMonitoringTransition()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final ArraySet<WindowContainer> targets = transition.mParticipants;
|
|
||||||
for (int i = targets.size() - 1; i >= 0; --i) {
|
for (int i = targets.size() - 1; i >= 0; --i) {
|
||||||
final WindowContainer wc = targets.valueAt(i);
|
final WindowContainer wc = targets.get(i).mContainer;
|
||||||
if (wc.asActivityRecord() == null && wc.asTask() == null) {
|
if (wc.asActivityRecord() == null && wc.asTask() == null
|
||||||
|
&& wc.asTaskFragment() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// WC can be visible due to setLaunchBehind
|
// WC can be visible due to setLaunchBehind
|
||||||
@@ -605,6 +605,9 @@ class BackNavigationController {
|
|||||||
final boolean matchAnimationTargets = isWaitBackTransition()
|
final boolean matchAnimationTargets = isWaitBackTransition()
|
||||||
&& (transition.mType == TRANSIT_CLOSE || transition.mType == TRANSIT_TO_BACK)
|
&& (transition.mType == TRANSIT_CLOSE || transition.mType == TRANSIT_TO_BACK)
|
||||||
&& mAnimationHandler.containsBackAnimationTargets(mTmpOpenApps, mTmpCloseApps);
|
&& mAnimationHandler.containsBackAnimationTargets(mTmpOpenApps, mTmpCloseApps);
|
||||||
|
ProtoLog.d(WM_DEBUG_BACK_PREVIEW,
|
||||||
|
"onTransactionReady, opening: %s, closing: %s, animating: %s, match: %b",
|
||||||
|
mTmpOpenApps, mTmpCloseApps, mAnimationHandler, matchAnimationTargets);
|
||||||
if (!matchAnimationTargets) {
|
if (!matchAnimationTargets) {
|
||||||
mNavigationMonitor.onTransitionReadyWhileNavigate(mTmpOpenApps, mTmpCloseApps);
|
mNavigationMonitor.onTransitionReadyWhileNavigate(mTmpOpenApps, mTmpCloseApps);
|
||||||
} else {
|
} else {
|
||||||
@@ -829,10 +832,16 @@ class BackNavigationController {
|
|||||||
if (!mComposed) {
|
if (!mComposed) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WC must be ActivityRecord in legacy transition, but it also can be Task or
|
||||||
|
// TaskFragment when using Shell transition.
|
||||||
|
// Open target: Can be Task or ActivityRecord or TaskFragment
|
||||||
|
// Close target: Limit to the top activity for now, to reduce the chance of misjudgment.
|
||||||
final WindowContainer target = open ? mOpenAdaptor.mTarget : mCloseAdaptor.mTarget;
|
final WindowContainer target = open ? mOpenAdaptor.mTarget : mCloseAdaptor.mTarget;
|
||||||
if (mSwitchType == TASK_SWITCH) {
|
if (mSwitchType == TASK_SWITCH) {
|
||||||
return wc == target
|
return wc == target
|
||||||
|| (wc.asTask() != null && wc.hasChild(target));
|
|| (wc.asTask() != null && wc.hasChild(target))
|
||||||
|
|| (wc.asActivityRecord() != null && target.hasChild(wc));
|
||||||
} else if (mSwitchType == ACTIVITY_SWITCH) {
|
} else if (mSwitchType == ACTIVITY_SWITCH) {
|
||||||
return wc == target || (wc.asTaskFragment() != null && wc.hasChild(target));
|
return wc == target || (wc.asTaskFragment() != null && wc.hasChild(target));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1199,13 +1199,12 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
|
|||||||
if (primaryDisplay.isKeyguardLocked()) {
|
if (primaryDisplay.isKeyguardLocked()) {
|
||||||
mFlags |= TRANSIT_FLAG_KEYGUARD_LOCKED;
|
mFlags |= TRANSIT_FLAG_KEYGUARD_LOCKED;
|
||||||
}
|
}
|
||||||
// Check whether the participants were animated from back navigation.
|
|
||||||
mController.mAtm.mBackNavigationController.onTransactionReady(this);
|
|
||||||
|
|
||||||
collectOrderChanges();
|
collectOrderChanges();
|
||||||
|
|
||||||
// Resolve the animating targets from the participants.
|
// Resolve the animating targets from the participants.
|
||||||
mTargets = calculateTargets(mParticipants, mChanges);
|
mTargets = calculateTargets(mParticipants, mChanges);
|
||||||
|
// Check whether the participants were animated from back navigation.
|
||||||
|
mController.mAtm.mBackNavigationController.onTransactionReady(this, mTargets);
|
||||||
final TransitionInfo info = calculateTransitionInfo(mType, mFlags, mTargets, transaction);
|
final TransitionInfo info = calculateTransitionInfo(mType, mFlags, mTargets, transaction);
|
||||||
info.setDebugId(mSyncId);
|
info.setDebugId(mSyncId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user