Merge "Update InputSink on transition finish" into tm-qpr-dev am: d1ef23ccc7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18789247

Change-Id: I04fab3e7715d6a40512777e1ee546226265788dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Evan Rosky
2022-06-08 17:56:33 +00:00
committed by Automerger Merge Worker
3 changed files with 17 additions and 5 deletions

View File

@@ -927,7 +927,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// SystemUi sets the pinned mode on activity after transition is done.
boolean mWaitForEnteringPinnedMode;
private final ActivityRecordInputSink mActivityRecordInputSink;
final ActivityRecordInputSink mActivityRecordInputSink;
// Activities with this uid are allowed to not create an input sink while being in the same
// task and directly above this ActivityRecord. This field is updated whenever a new activity
@@ -7971,7 +7971,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
boolean isInTransition() {
return mTransitionController.inTransition() // Shell transitions.
return mTransitionController.inTransition(this) // Shell transitions.
|| isAnimating(PARENTS | TRANSITION); // Legacy transitions.
}

View File

@@ -81,8 +81,8 @@ class ActivityRecordInputSink {
// Don't block touches from passing through to an activity below us in the same task, if
// that activity is either from the same uid or if that activity has launched an activity
// in our uid.
final ActivityRecord activityBelowInTask =
mActivityRecord.getTask().getActivityBelow(mActivityRecord);
final ActivityRecord activityBelowInTask = mActivityRecord.getTask() != null
? mActivityRecord.getTask().getActivityBelow(mActivityRecord) : null;
final boolean allowPassthrough = activityBelowInTask != null && (
activityBelowInTask.mAllowedTouchUid == mActivityRecord.getUid()
|| activityBelowInTask.isUid(mActivityRecord.getUid()));

View File

@@ -95,7 +95,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
/**
@@ -656,6 +655,19 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
mController.dispatchLegacyAppTransitionFinished(ar);
}
}
// Update the input-sink (touch-blocking) state now that the animation is finished.
SurfaceControl.Transaction inputSinkTransaction = null;
for (int i = 0; i < mParticipants.size(); ++i) {
final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord();
if (ar == null || !ar.isVisible()) continue;
if (inputSinkTransaction == null) {
inputSinkTransaction = new SurfaceControl.Transaction();
}
ar.mActivityRecordInputSink.applyChangesToSurfaceIfChanged(inputSinkTransaction);
}
if (inputSinkTransaction != null) inputSinkTransaction.apply();
// Always schedule stop processing when transition finishes because activities don't
// stop while they are in a transition thus their stop could still be pending.
mController.mAtm.mTaskSupervisor