Loading services/core/java/com/android/server/wm/ActivityRecord.java +0 −6 Original line number Diff line number Diff line Loading @@ -181,7 +181,6 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_FREE_RESIZE; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_WINDOWING_MODE_RESIZE; import static com.android.server.wm.ActivityTaskManagerService.SKIP_LAYOUT_REASON_ALLOWED; import static com.android.server.wm.ActivityTaskManagerService.getInputDispatchingTimeoutMillisLocked; import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS; import static com.android.server.wm.IdentifierProto.HASH_CODE; Loading Loading @@ -5359,11 +5358,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mAtmService.deferWindowLayout(); try { task.completePauseLocked(true /* resumeNext */, null /* resumingActivity */); // If there is no possible transition to execute, then allow to skip layout // because it may be done by next resumed activity. if (!pausingActivity.mDisplayContent.areOpeningAppsReady()) { mAtmService.addWindowLayoutReasons(SKIP_LAYOUT_REASON_ALLOWED); } } finally { mAtmService.continueWindowLayout(); } Loading services/core/java/com/android/server/wm/ActivityStarter.java +0 −2 Original line number Diff line number Diff line Loading @@ -1549,8 +1549,6 @@ class ActivityStarter { mService.getTransitionController().collect(r); try { mService.deferWindowLayout(); // Allow to skip layout because it may be done by the window of the starting activity. mService.addWindowLayoutReasons(ActivityTaskManagerService.SKIP_LAYOUT_REASON_ALLOWED); Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "startActivityInner"); result = startActivityInner(r, sourceRecord, voiceSession, voiceInteractor, startFlags, doResume, options, inTask, restrictedBgActivity, intentGrants); Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +8 −38 Original line number Diff line number Diff line Loading @@ -657,27 +657,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @IntDef({ LAYOUT_REASON_CONFIG_CHANGED, LAYOUT_REASON_VISIBILITY_CHANGED, SKIP_LAYOUT_REASON_ALLOWED, SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT, }) @interface LayoutReason { } static final int LAYOUT_REASON_MASK = 0x0000ffff; static final int LAYOUT_REASON_CONFIG_CHANGED = 0x1; static final int LAYOUT_REASON_VISIBILITY_CHANGED = 0x2; static final int SKIP_LAYOUT_REASON_MASK = 0xfffe0000; /** * Allow to call {@link WindowSurfacePlacer#endDeferAndSkipLayout} if there is a reason * included in {@link #SKIP_LAYOUT_REASON_MASK} was added. */ static final int SKIP_LAYOUT_REASON_ALLOWED = 1 << 16; /** Used when the client is scheduled to call relayout. */ static final int SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT = 1 << 17; /** The reasons to perform or skip surface placement. */ /** The reasons to perform surface placement. */ @LayoutReason private int mLayoutReasons; Loading Loading @@ -4205,35 +4192,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mWindowManager.mWindowPlacerLocked.deferLayout(); } /** * @see WindowSurfacePlacer#continueLayout * @see WindowSurfacePlacer#endDeferAndSkipLayout */ /** @see WindowSurfacePlacer#continueLayout */ void continueWindowLayout() { if ((mLayoutReasons & SKIP_LAYOUT_REASON_ALLOWED) != 0) { final int skipReasons = mLayoutReasons & SKIP_LAYOUT_REASON_MASK; if (skipReasons != 0) { if (DEBUG_ALL) { Slog.i(TAG, "continueWindowLayout skip-reasons=" + Integer.toHexString(skipReasons)); } mWindowManager.mWindowPlacerLocked.endDeferAndSkipLayout(); return; } } final int reasons = mLayoutReasons & LAYOUT_REASON_MASK; mWindowManager.mWindowPlacerLocked.continueLayout(reasons != 0); if (DEBUG_ALL && reasons != 0 && !mWindowManager.mWindowPlacerLocked.isLayoutDeferred()) { Slog.i(TAG, "continueWindowLayout reasons=" + Integer.toHexString(reasons)); mWindowManager.mWindowPlacerLocked.continueLayout(mLayoutReasons != 0); if (DEBUG_ALL && !mWindowManager.mWindowPlacerLocked.isLayoutDeferred()) { Slog.i(TAG, "continueWindowLayout reason=" + mLayoutReasons); } } /** * If a reason within {@link #LAYOUT_REASON_MASK} is added between {@link #deferWindowLayout} * and {@link #continueWindowLayout}, {@link WindowSurfacePlacer#performSurfacePlacement} will * be called when the last defer count is gone. Note that the {@link #SKIP_LAYOUT_REASON_MASK} * has higher priority to determine whether to perform layout. * If a reason is added between {@link #deferWindowLayout} and {@link #continueWindowLayout}, * it will make sure {@link WindowSurfacePlacer#performSurfacePlacement} is called when the last * defer count is gone. */ void addWindowLayoutReasons(@LayoutReason int reasons) { mLayoutReasons |= reasons; Loading services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +0 −3 Original line number Diff line number Diff line Loading @@ -938,9 +938,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { if (r.app != null) { r.app.updateServiceConnectionActivities(); } // Expect a window of the starting activity will perform relayout. mService.addWindowLayoutReasons( ActivityTaskManagerService.SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT); return true; } Loading services/core/java/com/android/server/wm/DisplayContent.java +0 −16 Original line number Diff line number Diff line Loading @@ -4035,22 +4035,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mLayoutNeeded; } /** Returns {@code true} if all opening apps may be ready to execute transition. */ boolean areOpeningAppsReady() { final int size = mOpeningApps.size(); for (int i = size - 1; i >= 0; i--) { final ActivityRecord r = mOpeningApps.valueAt(i); if (!r.hasVisible) { return false; } final WindowState w = r.findMainWindow(); if (w != null && !w.isDrawn()) { return false; } } return size > 0; } void dumpTokens(PrintWriter pw, boolean dumpAll) { if (mTokenMap.isEmpty()) { return; Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +0 −6 Original line number Diff line number Diff line Loading @@ -181,7 +181,6 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_FREE_RESIZE; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_WINDOWING_MODE_RESIZE; import static com.android.server.wm.ActivityTaskManagerService.SKIP_LAYOUT_REASON_ALLOWED; import static com.android.server.wm.ActivityTaskManagerService.getInputDispatchingTimeoutMillisLocked; import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS; import static com.android.server.wm.IdentifierProto.HASH_CODE; Loading Loading @@ -5359,11 +5358,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mAtmService.deferWindowLayout(); try { task.completePauseLocked(true /* resumeNext */, null /* resumingActivity */); // If there is no possible transition to execute, then allow to skip layout // because it may be done by next resumed activity. if (!pausingActivity.mDisplayContent.areOpeningAppsReady()) { mAtmService.addWindowLayoutReasons(SKIP_LAYOUT_REASON_ALLOWED); } } finally { mAtmService.continueWindowLayout(); } Loading
services/core/java/com/android/server/wm/ActivityStarter.java +0 −2 Original line number Diff line number Diff line Loading @@ -1549,8 +1549,6 @@ class ActivityStarter { mService.getTransitionController().collect(r); try { mService.deferWindowLayout(); // Allow to skip layout because it may be done by the window of the starting activity. mService.addWindowLayoutReasons(ActivityTaskManagerService.SKIP_LAYOUT_REASON_ALLOWED); Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "startActivityInner"); result = startActivityInner(r, sourceRecord, voiceSession, voiceInteractor, startFlags, doResume, options, inTask, restrictedBgActivity, intentGrants); Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +8 −38 Original line number Diff line number Diff line Loading @@ -657,27 +657,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @IntDef({ LAYOUT_REASON_CONFIG_CHANGED, LAYOUT_REASON_VISIBILITY_CHANGED, SKIP_LAYOUT_REASON_ALLOWED, SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT, }) @interface LayoutReason { } static final int LAYOUT_REASON_MASK = 0x0000ffff; static final int LAYOUT_REASON_CONFIG_CHANGED = 0x1; static final int LAYOUT_REASON_VISIBILITY_CHANGED = 0x2; static final int SKIP_LAYOUT_REASON_MASK = 0xfffe0000; /** * Allow to call {@link WindowSurfacePlacer#endDeferAndSkipLayout} if there is a reason * included in {@link #SKIP_LAYOUT_REASON_MASK} was added. */ static final int SKIP_LAYOUT_REASON_ALLOWED = 1 << 16; /** Used when the client is scheduled to call relayout. */ static final int SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT = 1 << 17; /** The reasons to perform or skip surface placement. */ /** The reasons to perform surface placement. */ @LayoutReason private int mLayoutReasons; Loading Loading @@ -4205,35 +4192,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mWindowManager.mWindowPlacerLocked.deferLayout(); } /** * @see WindowSurfacePlacer#continueLayout * @see WindowSurfacePlacer#endDeferAndSkipLayout */ /** @see WindowSurfacePlacer#continueLayout */ void continueWindowLayout() { if ((mLayoutReasons & SKIP_LAYOUT_REASON_ALLOWED) != 0) { final int skipReasons = mLayoutReasons & SKIP_LAYOUT_REASON_MASK; if (skipReasons != 0) { if (DEBUG_ALL) { Slog.i(TAG, "continueWindowLayout skip-reasons=" + Integer.toHexString(skipReasons)); } mWindowManager.mWindowPlacerLocked.endDeferAndSkipLayout(); return; } } final int reasons = mLayoutReasons & LAYOUT_REASON_MASK; mWindowManager.mWindowPlacerLocked.continueLayout(reasons != 0); if (DEBUG_ALL && reasons != 0 && !mWindowManager.mWindowPlacerLocked.isLayoutDeferred()) { Slog.i(TAG, "continueWindowLayout reasons=" + Integer.toHexString(reasons)); mWindowManager.mWindowPlacerLocked.continueLayout(mLayoutReasons != 0); if (DEBUG_ALL && !mWindowManager.mWindowPlacerLocked.isLayoutDeferred()) { Slog.i(TAG, "continueWindowLayout reason=" + mLayoutReasons); } } /** * If a reason within {@link #LAYOUT_REASON_MASK} is added between {@link #deferWindowLayout} * and {@link #continueWindowLayout}, {@link WindowSurfacePlacer#performSurfacePlacement} will * be called when the last defer count is gone. Note that the {@link #SKIP_LAYOUT_REASON_MASK} * has higher priority to determine whether to perform layout. * If a reason is added between {@link #deferWindowLayout} and {@link #continueWindowLayout}, * it will make sure {@link WindowSurfacePlacer#performSurfacePlacement} is called when the last * defer count is gone. */ void addWindowLayoutReasons(@LayoutReason int reasons) { mLayoutReasons |= reasons; Loading
services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +0 −3 Original line number Diff line number Diff line Loading @@ -938,9 +938,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { if (r.app != null) { r.app.updateServiceConnectionActivities(); } // Expect a window of the starting activity will perform relayout. mService.addWindowLayoutReasons( ActivityTaskManagerService.SKIP_LAYOUT_REASON_EXPECT_NEXT_RELAYOUT); return true; } Loading
services/core/java/com/android/server/wm/DisplayContent.java +0 −16 Original line number Diff line number Diff line Loading @@ -4035,22 +4035,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mLayoutNeeded; } /** Returns {@code true} if all opening apps may be ready to execute transition. */ boolean areOpeningAppsReady() { final int size = mOpeningApps.size(); for (int i = size - 1; i >= 0; i--) { final ActivityRecord r = mOpeningApps.valueAt(i); if (!r.hasVisible) { return false; } final WindowState w = r.findMainWindow(); if (w != null && !w.isDrawn()) { return false; } } return size > 0; } void dumpTokens(PrintWriter pw, boolean dumpAll) { if (mTokenMap.isEmpty()) { return; Loading