Loading services/core/java/com/android/server/wm/ActivityRecord.java +24 −32 Original line number Diff line number Diff line Loading @@ -42,9 +42,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.app.WindowConfiguration.activityTypeToString; import static android.content.Intent.ACTION_MAIN; import static android.content.Intent.CATEGORY_HOME; Loading Loading @@ -6529,7 +6527,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A updateSurfacePosition(); } adjustPinnedStackAndInitChangeTransitionIfNeeded(prevWinMode, getWindowingMode()); final int newWinMode = getWindowingMode(); if ((prevWinMode != newWinMode) && (mDisplayContent != null) && shouldStartChangeTransition(prevWinMode, newWinMode)) { initializeChangeTransition(mTmpPrevBounds); } // Configuration's equality doesn't consider seq so if only seq number changes in resolved // override configuration. Therefore ConfigurationContainer doesn't change merged override Loading Loading @@ -6563,17 +6565,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } private void adjustPinnedStackAndInitChangeTransitionIfNeeded(int prevWinMode, int winMode) { if (prevWinMode == winMode || mDisplayContent == null) { return; } if (prevWinMode == WINDOWING_MODE_PINNED && winMode != WINDOWING_MODE_UNDEFINED && !isHidden()) { void savePinnedStackBounds() { // Leaving PiP to fullscreen, save the snap fraction based on the pre-animation bounds // for the next re-entry into PiP (assuming the activity is not hidden or destroyed) final TaskStack pinnedStack = mDisplayContent.getPinnedStack(); if (pinnedStack != null) { if (pinnedStack == null) return; final Rect stackBounds; if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) { // We are animating the bounds, use the pre-animation bounds to save the snap Loading @@ -6589,10 +6585,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mDisplayContent.mPinnedStackControllerLocked.saveReentrySnapFraction( mActivityComponent, stackBounds); } } else if (shouldStartChangeTransition(prevWinMode, winMode)) { initializeChangeTransition(mTmpPrevBounds); } } /** Returns true if the configuration is compatible with this activity. */ boolean isConfigurationCompatible(Configuration config) { Loading services/core/java/com/android/server/wm/TaskRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -588,6 +588,13 @@ class TaskRecord extends Task { boolean kept = true; try { final ActivityRecord r = topRunningActivityLocked(); // give pinned stack a chance to save current bounds, this needs to be before the // actual reparent. if (inPinnedWindowingMode() && !(toStackWindowingMode == WINDOWING_MODE_UNDEFINED) && !r.isHidden()) { r.savePinnedStackBounds(); } final boolean wasFocused = r != null && root.isTopDisplayFocusedStack(sourceStack) && (topRunningActivityLocked() == r); final boolean wasResumed = r != null && sourceStack.getResumedActivity() == r; Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +24 −32 Original line number Diff line number Diff line Loading @@ -42,9 +42,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.app.WindowConfiguration.activityTypeToString; import static android.content.Intent.ACTION_MAIN; import static android.content.Intent.CATEGORY_HOME; Loading Loading @@ -6529,7 +6527,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A updateSurfacePosition(); } adjustPinnedStackAndInitChangeTransitionIfNeeded(prevWinMode, getWindowingMode()); final int newWinMode = getWindowingMode(); if ((prevWinMode != newWinMode) && (mDisplayContent != null) && shouldStartChangeTransition(prevWinMode, newWinMode)) { initializeChangeTransition(mTmpPrevBounds); } // Configuration's equality doesn't consider seq so if only seq number changes in resolved // override configuration. Therefore ConfigurationContainer doesn't change merged override Loading Loading @@ -6563,17 +6565,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } private void adjustPinnedStackAndInitChangeTransitionIfNeeded(int prevWinMode, int winMode) { if (prevWinMode == winMode || mDisplayContent == null) { return; } if (prevWinMode == WINDOWING_MODE_PINNED && winMode != WINDOWING_MODE_UNDEFINED && !isHidden()) { void savePinnedStackBounds() { // Leaving PiP to fullscreen, save the snap fraction based on the pre-animation bounds // for the next re-entry into PiP (assuming the activity is not hidden or destroyed) final TaskStack pinnedStack = mDisplayContent.getPinnedStack(); if (pinnedStack != null) { if (pinnedStack == null) return; final Rect stackBounds; if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) { // We are animating the bounds, use the pre-animation bounds to save the snap Loading @@ -6589,10 +6585,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mDisplayContent.mPinnedStackControllerLocked.saveReentrySnapFraction( mActivityComponent, stackBounds); } } else if (shouldStartChangeTransition(prevWinMode, winMode)) { initializeChangeTransition(mTmpPrevBounds); } } /** Returns true if the configuration is compatible with this activity. */ boolean isConfigurationCompatible(Configuration config) { Loading
services/core/java/com/android/server/wm/TaskRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -588,6 +588,13 @@ class TaskRecord extends Task { boolean kept = true; try { final ActivityRecord r = topRunningActivityLocked(); // give pinned stack a chance to save current bounds, this needs to be before the // actual reparent. if (inPinnedWindowingMode() && !(toStackWindowingMode == WINDOWING_MODE_UNDEFINED) && !r.isHidden()) { r.savePinnedStackBounds(); } final boolean wasFocused = r != null && root.isTopDisplayFocusedStack(sourceStack) && (topRunningActivityLocked() == r); final boolean wasResumed = r != null && sourceStack.getResumedActivity() == r; Loading