Merge "Revert "Deferring visibility updates while applying WCT"" into sc-v2-dev am: 100b9f73e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15347902 Change-Id: I9913fbeec08501c35bcdaacb58df6f84c9dd8089
This commit is contained in:
@@ -352,12 +352,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
*/
|
*/
|
||||||
private int mVisibilityTransactionDepth;
|
private int mVisibilityTransactionDepth;
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to the visibility updates that started from {@code RootWindowContainer} should be
|
|
||||||
* deferred.
|
|
||||||
*/
|
|
||||||
private boolean mDeferRootVisibilityUpdate;
|
|
||||||
|
|
||||||
private ActivityMetricsLogger mActivityMetricsLogger;
|
private ActivityMetricsLogger mActivityMetricsLogger;
|
||||||
|
|
||||||
/** Check if placing task or activity on specified display is allowed. */
|
/** Check if placing task or activity on specified display is allowed. */
|
||||||
@@ -2293,14 +2287,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
return mVisibilityTransactionDepth > 0;
|
return mVisibilityTransactionDepth > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDeferRootVisibilityUpdate(boolean deferUpdate) {
|
|
||||||
mDeferRootVisibilityUpdate = deferUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isRootVisibilityUpdateDeferred() {
|
|
||||||
return mDeferRootVisibilityUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the state or visibility of an attached activity is changed.
|
* Called when the state or visibility of an attached activity is changed.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1980,8 +1980,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
*/
|
*/
|
||||||
void ensureActivitiesVisible(ActivityRecord starting, int configChanges,
|
void ensureActivitiesVisible(ActivityRecord starting, int configChanges,
|
||||||
boolean preserveWindows, boolean notifyClients) {
|
boolean preserveWindows, boolean notifyClients) {
|
||||||
if (mTaskSupervisor.inActivityVisibilityUpdate()
|
if (mTaskSupervisor.inActivityVisibilityUpdate()) {
|
||||||
|| mTaskSupervisor.isRootVisibilityUpdateDeferred()) {
|
|
||||||
// Don't do recursive work.
|
// Don't do recursive work.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4642,10 +4642,8 @@ class Task extends TaskFragment {
|
|||||||
mAtmService.continueWindowLayout();
|
mAtmService.continueWindowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mTaskSupervisor.isRootVisibilityUpdateDeferred()) {
|
mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
|
||||||
mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
|
mRootWindowContainer.resumeFocusedTasksTopActivities();
|
||||||
mRootWindowContainer.resumeFocusedTasksTopActivities();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resumeNextFocusAfterReparent() {
|
void resumeNextFocusAfterReparent() {
|
||||||
|
|||||||
@@ -319,7 +319,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
int effects = 0;
|
int effects = 0;
|
||||||
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Apply window transaction, syncId=%d", syncId);
|
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Apply window transaction, syncId=%d", syncId);
|
||||||
mService.deferWindowLayout();
|
mService.deferWindowLayout();
|
||||||
mService.mTaskSupervisor.setDeferRootVisibilityUpdate(true /* deferUpdate */);
|
|
||||||
try {
|
try {
|
||||||
if (transition != null) {
|
if (transition != null) {
|
||||||
// First check if we have a display rotation transition and if so, update it.
|
// First check if we have a display rotation transition and if so, update it.
|
||||||
@@ -408,7 +407,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
task.setMainWindowSizeChangeTransaction(sft);
|
task.setMainWindowSizeChangeTransaction(sft);
|
||||||
}
|
}
|
||||||
if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) {
|
if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) {
|
||||||
mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
|
|
||||||
// Already calls ensureActivityConfig
|
// Already calls ensureActivityConfig
|
||||||
mService.mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
|
mService.mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
|
||||||
mService.mRootWindowContainer.resumeFocusedTasksTopActivities();
|
mService.mRootWindowContainer.resumeFocusedTasksTopActivities();
|
||||||
@@ -430,7 +428,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
mService.addWindowLayoutReasons(LAYOUT_REASON_CONFIG_CHANGED);
|
mService.addWindowLayoutReasons(LAYOUT_REASON_CONFIG_CHANGED);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
|
|
||||||
mService.continueWindowLayout();
|
mService.continueWindowLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user