Loading services/core/java/com/android/server/wm/Task.java +19 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.graphics.Rect; import android.util.EventLog; import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.Display; import android.view.Surface; import android.view.SurfaceControl; Loading @@ -68,7 +69,12 @@ class Task extends WindowContainer<AppWindowToken> { // Bounds used to calculate the insets. private final Rect mTempInsetBounds = new Rect(); // Device rotation as of the last time {@link #mBounds} was set. /** ID of the display which rotation {@link #mRotation} has. */ private int mLastRotationDisplayId = Display.INVALID_DISPLAY; /** * Display rotation as of the last time {@link #setBounds(Rect)} was called or this task was * moved to a new display. */ private int mRotation; // For comparison with DisplayContent bounds. Loading Loading @@ -510,8 +516,20 @@ class Task extends WindowContainer<AppWindowToken> { setBounds(null); return; } final int displayId = displayContent.getDisplayId(); final int newRotation = displayContent.getDisplayInfo().rotation; if (displayId != mLastRotationDisplayId) { // This task is on a display that it wasn't on. There is no point to keep the relative // position if display rotations for old and new displays are different. Just keep these // values. mLastRotationDisplayId = displayId; mRotation = newRotation; return; } if (mRotation == newRotation) { // Rotation didn't change. We don't need to adjust the bounds to keep the relative // position. return; } Loading services/core/java/com/android/server/wm/TaskStack.java +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER; import static com.android.server.wm.StackProto.ADJUSTED_BOUNDS; import static com.android.server.wm.StackProto.ADJUSTED_FOR_IME; Loading Loading @@ -63,10 +64,12 @@ import android.util.proto.ProtoOutputStream; import android.view.DisplayInfo; import android.view.Surface; import android.view.SurfaceControl; import com.android.internal.policy.DividerSnapAlgorithm; import com.android.internal.policy.DividerSnapAlgorithm.SnapTarget; import com.android.internal.policy.DockedDividerUtils; import com.android.server.EventLogTags; import java.io.PrintWriter; public class TaskStack extends WindowContainer<Task> implements Loading Loading @@ -99,7 +102,7 @@ public class TaskStack extends WindowContainer<Task> implements */ private final Rect mFullyAdjustedImeBounds = new Rect(); // Device rotation as of the last time {@link #mBounds} was set. // Display rotation as of the last time {@link #mBounds} was set. private int mRotation; /** Density as of last time {@link #mBounds} was set. */ Loading Loading
services/core/java/com/android/server/wm/Task.java +19 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.graphics.Rect; import android.util.EventLog; import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.Display; import android.view.Surface; import android.view.SurfaceControl; Loading @@ -68,7 +69,12 @@ class Task extends WindowContainer<AppWindowToken> { // Bounds used to calculate the insets. private final Rect mTempInsetBounds = new Rect(); // Device rotation as of the last time {@link #mBounds} was set. /** ID of the display which rotation {@link #mRotation} has. */ private int mLastRotationDisplayId = Display.INVALID_DISPLAY; /** * Display rotation as of the last time {@link #setBounds(Rect)} was called or this task was * moved to a new display. */ private int mRotation; // For comparison with DisplayContent bounds. Loading Loading @@ -510,8 +516,20 @@ class Task extends WindowContainer<AppWindowToken> { setBounds(null); return; } final int displayId = displayContent.getDisplayId(); final int newRotation = displayContent.getDisplayInfo().rotation; if (displayId != mLastRotationDisplayId) { // This task is on a display that it wasn't on. There is no point to keep the relative // position if display rotations for old and new displays are different. Just keep these // values. mLastRotationDisplayId = displayId; mRotation = newRotation; return; } if (mRotation == newRotation) { // Rotation didn't change. We don't need to adjust the bounds to keep the relative // position. return; } Loading
services/core/java/com/android/server/wm/TaskStack.java +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER; import static com.android.server.wm.StackProto.ADJUSTED_BOUNDS; import static com.android.server.wm.StackProto.ADJUSTED_FOR_IME; Loading Loading @@ -63,10 +64,12 @@ import android.util.proto.ProtoOutputStream; import android.view.DisplayInfo; import android.view.Surface; import android.view.SurfaceControl; import com.android.internal.policy.DividerSnapAlgorithm; import com.android.internal.policy.DividerSnapAlgorithm.SnapTarget; import com.android.internal.policy.DockedDividerUtils; import com.android.server.EventLogTags; import java.io.PrintWriter; public class TaskStack extends WindowContainer<Task> implements Loading Loading @@ -99,7 +102,7 @@ public class TaskStack extends WindowContainer<Task> implements */ private final Rect mFullyAdjustedImeBounds = new Rect(); // Device rotation as of the last time {@link #mBounds} was set. // Display rotation as of the last time {@link #mBounds} was set. private int mRotation; /** Density as of last time {@link #mBounds} was set. */ Loading