Merge "Prevent extraneous saving of pinned snap fraction." into pi-dev

This commit is contained in:
Winson Chung
2018-04-11 02:32:46 +00:00
committed by Android (Google) Code Review
3 changed files with 5 additions and 1 deletions

View File

@@ -220,6 +220,7 @@ message StackProto {
optional float adjust_ime_amount = 10;
optional float adjust_divider_amount = 11;
optional .android.graphics.RectProto adjusted_bounds = 12;
optional bool animating_bounds = 13;
}
/* represents Task */

View File

@@ -1312,7 +1312,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (prevWinMode != WINDOWING_MODE_UNDEFINED && winMode == WINDOWING_MODE_PINNED) {
// Entering PiP from fullscreen, reset the snap fraction
mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(this);
} else if (prevWinMode == WINDOWING_MODE_PINNED && winMode != WINDOWING_MODE_UNDEFINED) {
} else if (prevWinMode == WINDOWING_MODE_PINNED && winMode != WINDOWING_MODE_UNDEFINED
&& !isHidden()) {
// 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();

View File

@@ -37,6 +37,7 @@ import static com.android.server.wm.StackProto.ADJUSTED_BOUNDS;
import static com.android.server.wm.StackProto.ADJUSTED_FOR_IME;
import static com.android.server.wm.StackProto.ADJUST_DIVIDER_AMOUNT;
import static com.android.server.wm.StackProto.ADJUST_IME_AMOUNT;
import static com.android.server.wm.StackProto.ANIMATING_BOUNDS;
import static com.android.server.wm.StackProto.ANIMATION_BACKGROUND_SURFACE_IS_DIMMING;
import static com.android.server.wm.StackProto.BOUNDS;
import static com.android.server.wm.StackProto.DEFER_REMOVAL;
@@ -1363,6 +1364,7 @@ public class TaskStack extends WindowContainer<Task> implements
proto.write(ADJUST_IME_AMOUNT, mAdjustImeAmount);
proto.write(ADJUST_DIVIDER_AMOUNT, mAdjustDividerAmount);
mAdjustedBounds.writeToProto(proto, ADJUSTED_BOUNDS);
proto.write(ANIMATING_BOUNDS, mBoundsAnimating);
proto.end(token);
}