Merge "Revert^2 Do not enter pip during transient launch" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
05b23f1e52
@@ -5255,17 +5255,21 @@ class Task extends TaskFragment {
|
||||
// Ensure that we do not trigger entering PiP an activity on the root pinned task.
|
||||
return;
|
||||
}
|
||||
final boolean isTransient = opts != null && opts.getTransientLaunch();
|
||||
final Task targetRootTask = toFrontTask != null
|
||||
? toFrontTask.getRootTask() : toFrontActivity.getRootTask();
|
||||
if (targetRootTask != null && (targetRootTask.isActivityTypeAssistant() || isTransient)) {
|
||||
// Ensure the task/activity being brought forward is not the assistant and is not
|
||||
// transient. In the case of transient-launch, we want to wait until the end of the
|
||||
// transition and only allow switch if the transient launch was committed.
|
||||
final Task targetRootTask = toFrontTask != null ? toFrontTask.getRootTask()
|
||||
: toFrontActivity != null ? toFrontActivity.getRootTask() : null;
|
||||
if (targetRootTask == null) {
|
||||
Slog.e(TAG, "No root task for enter pip, both to front task and activity are null?");
|
||||
return;
|
||||
}
|
||||
pipCandidate.supportsEnterPipOnTaskSwitch = true;
|
||||
final boolean isTransient = opts != null && opts.getTransientLaunch()
|
||||
|| (targetRootTask.mTransitionController.isTransientHide(targetRootTask));
|
||||
|
||||
// Ensure the task/activity being brought forward is not the assistant and is not transient
|
||||
// nor transient hide target. In the case of transient-launch, we want to wait until the end
|
||||
// of the transition and only allow to enter pip on task switch after the transient launch
|
||||
// was committed.
|
||||
pipCandidate.supportsEnterPipOnTaskSwitch = !targetRootTask.isActivityTypeAssistant()
|
||||
&& !isTransient;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user