Fix transition timeout when launching activity in TaskFragment

Transition timeout due to the sync group was not ready. It was
set to false when an activity was started while a transition
was already collecting. Somehow, the activity was resumed
already because there was no need to pause the previous top
activity. So, the transition won't be set to ready afterwards.

Bug: 274540105
Test: verified both on sample app and Settings
Change-Id: Ib18652f610b448beb12eeb98a473399832d71dc5
This commit is contained in:
Louis Chang
2023-03-31 06:51:14 +00:00
parent 36fef761f1
commit c058b8aa5b
3 changed files with 9 additions and 7 deletions

View File

@@ -1297,6 +1297,12 @@
"group": "WM_DEBUG_BOOT",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
"-874087484": {
"message": "SyncGroup %d: Set ready %b",
"level": "VERBOSE",
"group": "WM_DEBUG_SYNC_ENGINE",
"at": "com\/android\/server\/wm\/BLASTSyncEngine.java"
},
"-869242375": {
"message": "Content Recording: Unable to start recording due to invalid region for display %d",
"level": "VERBOSE",
@@ -4003,12 +4009,6 @@
"group": "WM_DEBUG_CONFIGURATION",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
"1689989893": {
"message": "SyncGroup %d: Set ready",
"level": "VERBOSE",
"group": "WM_DEBUG_SYNC_ENGINE",
"at": "com\/android\/server\/wm\/BLASTSyncEngine.java"
},
"1699269281": {
"message": "Don't organize or trigger events for untrusted displayId=%d",
"level": "WARN",

View File

@@ -1606,6 +1606,8 @@ class ActivityStarter {
transitionController.requestStartTransition(newTransition,
mTargetTask == null ? started.getTask() : mTargetTask,
remoteTransition, null /* displayChange */);
} else if (result == START_SUCCESS && mStartActivity.isState(RESUMED)) {
// Do nothing if the activity is started and is resumed directly.
} else if (isStarted) {
// Make the collecting transition wait until this request is ready.
transitionController.setReady(started, false);

View File

@@ -228,7 +228,7 @@ class BLASTSyncEngine {
if (mReady == ready) {
return;
}
ProtoLog.v(WM_DEBUG_SYNC_ENGINE, "SyncGroup %d: Set ready", mSyncId);
ProtoLog.v(WM_DEBUG_SYNC_ENGINE, "SyncGroup %d: Set ready %b", mSyncId, ready);
mReady = ready;
if (!ready) return;
mWm.mWindowPlacerLocked.requestTraversal();