Merge "Added getSyncTransaction" into rvc-dev am: 652a48156c
Change-Id: I116da3681ce515ab8cbe83e4d9260094623ffbe6
This commit is contained in:
@@ -5985,9 +5985,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
|
||||
if (mSurfaceControl != null) {
|
||||
if (show && !mLastSurfaceShowing) {
|
||||
getPendingTransaction().show(mSurfaceControl);
|
||||
getSyncTransaction().show(mSurfaceControl);
|
||||
} else if (!show && mLastSurfaceShowing) {
|
||||
getPendingTransaction().hide(mSurfaceControl);
|
||||
getSyncTransaction().hide(mSurfaceControl);
|
||||
}
|
||||
}
|
||||
if (mThumbnail != null) {
|
||||
|
||||
@@ -3213,7 +3213,7 @@ class ActivityStack extends Task {
|
||||
}
|
||||
|
||||
private void updateSurfaceBounds() {
|
||||
updateSurfaceSize(getPendingTransaction());
|
||||
updateSurfaceSize(getSyncTransaction());
|
||||
updateSurfacePosition();
|
||||
scheduleAnimation();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class Dimmer {
|
||||
|
||||
@Override
|
||||
public SurfaceControl.Transaction getPendingTransaction() {
|
||||
return mHost.getPendingTransaction();
|
||||
return mHost.getSyncTransaction();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -290,7 +290,7 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> {
|
||||
mDimmer.resetDimStates();
|
||||
}
|
||||
|
||||
if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
|
||||
if (mDimmer.updateDims(getSyncTransaction(), mTmpDimBoundsRect)) {
|
||||
scheduleAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1923,7 +1923,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
super.onConfigurationChanged(newParentConfig);
|
||||
// Only need to update surface size here since the super method will handle updating
|
||||
// surface position.
|
||||
updateSurfaceSize(getPendingTransaction());
|
||||
updateSurfaceSize(getSyncTransaction());
|
||||
|
||||
if (wasInPictureInPicture != inPinnedWindowingMode()) {
|
||||
mStackSupervisor.scheduleUpdatePictureInPictureModeIfNeeded(this, getStack());
|
||||
@@ -3475,20 +3475,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
return mDimmer;
|
||||
}
|
||||
|
||||
void dim(float alpha) {
|
||||
mDimmer.dimAbove(getPendingTransaction(), alpha);
|
||||
scheduleAnimation();
|
||||
}
|
||||
|
||||
void stopDimming() {
|
||||
mDimmer.stopDim(getPendingTransaction());
|
||||
scheduleAnimation();
|
||||
}
|
||||
|
||||
boolean isTaskForUser(int userId) {
|
||||
return mUserId == userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
void prepareSurfaces() {
|
||||
mDimmer.resetDimStates();
|
||||
@@ -3504,9 +3490,9 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
mTmpDimBoundsRect.offsetTo(0, 0);
|
||||
}
|
||||
|
||||
updateShadowsRadius(isFocused(), getPendingTransaction());
|
||||
updateShadowsRadius(isFocused(), getSyncTransaction());
|
||||
|
||||
if (mDimmer.updateDims(getPendingTransaction(), mTmpDimBoundsRect)) {
|
||||
if (mDimmer.updateDims(getSyncTransaction(), mTmpDimBoundsRect)) {
|
||||
scheduleAnimation();
|
||||
}
|
||||
}
|
||||
@@ -4317,7 +4303,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
// skip this for tasks created by the organizer because they can synchronously update
|
||||
// the leash before new children are added to the task.
|
||||
if (!mCreatedByOrganizer && mTaskOrganizer != null && !prevHasBeenVisible) {
|
||||
getPendingTransaction().hide(getSurfaceControl());
|
||||
getSyncTransaction().hide(getSurfaceControl());
|
||||
commitPendingTransaction();
|
||||
}
|
||||
|
||||
@@ -4500,7 +4486,7 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
* @param hasFocus
|
||||
*/
|
||||
void onWindowFocusChanged(boolean hasFocus) {
|
||||
updateShadowsRadius(hasFocus, getPendingTransaction());
|
||||
updateShadowsRadius(hasFocus, getSyncTransaction());
|
||||
}
|
||||
|
||||
void onPictureInPictureParamsChanged() {
|
||||
|
||||
@@ -646,7 +646,7 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
|
||||
mSplitScreenDividerAnchor = makeChildSurface(null)
|
||||
.setName("splitScreenDividerAnchor")
|
||||
.build();
|
||||
getPendingTransaction()
|
||||
getSyncTransaction()
|
||||
.show(mAppAnimationLayer)
|
||||
.show(mBoostedAppAnimationLayer)
|
||||
.show(mHomeAppAnimationLayer)
|
||||
|
||||
@@ -386,7 +386,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
// surface animator such that hierarchy is preserved when animating, i.e.
|
||||
// mSurfaceControl stays attached to the leash and we just reparent the leash to the
|
||||
// new parent.
|
||||
reparentSurfaceControl(getPendingTransaction(), mParent.mSurfaceControl);
|
||||
reparentSurfaceControl(getSyncTransaction(), mParent.mSurfaceControl);
|
||||
}
|
||||
|
||||
if (callback != null) {
|
||||
@@ -404,8 +404,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
|
||||
private void setInitialSurfaceControlProperties(SurfaceControl surfaceControl) {
|
||||
setSurfaceControl(surfaceControl);
|
||||
getPendingTransaction().show(mSurfaceControl);
|
||||
onSurfaceShown(getPendingTransaction());
|
||||
getSyncTransaction().show(mSurfaceControl);
|
||||
onSurfaceShown(getSyncTransaction());
|
||||
updateSurfacePosition();
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
void removeImmediately() {
|
||||
final DisplayContent dc = getDisplayContent();
|
||||
if (dc != null) {
|
||||
mSurfaceFreezer.unfreeze(getPendingTransaction());
|
||||
mSurfaceFreezer.unfreeze(getSyncTransaction());
|
||||
dc.mChangingContainers.remove(this);
|
||||
}
|
||||
while (!mChildren.isEmpty()) {
|
||||
@@ -590,7 +590,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
}
|
||||
|
||||
if (mSurfaceControl != null) {
|
||||
getPendingTransaction().remove(mSurfaceControl);
|
||||
getSyncTransaction().remove(mSurfaceControl);
|
||||
setSurfaceControl(null);
|
||||
mLastSurfacePosition.set(0, 0);
|
||||
scheduleAnimation();
|
||||
@@ -1002,7 +1002,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
void onChildVisibilityRequested(boolean visible) {
|
||||
// If we are changing visibility, then a snapshot isn't necessary and we are no-longer
|
||||
// part of a change transition.
|
||||
mSurfaceFreezer.unfreeze(getPendingTransaction());
|
||||
mSurfaceFreezer.unfreeze(getSyncTransaction());
|
||||
if (mDisplayContent != null) {
|
||||
mDisplayContent.mChangingContainers.remove(this);
|
||||
}
|
||||
@@ -1901,7 +1901,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
}
|
||||
|
||||
void assignChildLayers() {
|
||||
assignChildLayers(getPendingTransaction());
|
||||
assignChildLayers(getSyncTransaction());
|
||||
scheduleAnimation();
|
||||
}
|
||||
|
||||
@@ -2050,12 +2050,23 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return mSurfaceControl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction getPendingTransaction() {
|
||||
/**
|
||||
* Use this method instead of {@link #getPendingTransaction()} if the Transaction should be
|
||||
* synchronized with the client.
|
||||
*
|
||||
* @return {@link #mBLASTSyncTransaction} if available. Otherwise, returns
|
||||
* {@link #getPendingTransaction()}
|
||||
*/
|
||||
public Transaction getSyncTransaction() {
|
||||
if (mUsingBLASTSyncTransaction) {
|
||||
return mBLASTSyncTransaction;
|
||||
}
|
||||
|
||||
return getPendingTransaction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction getPendingTransaction() {
|
||||
final DisplayContent displayContent = getDisplayContent();
|
||||
if (displayContent != null && displayContent != this) {
|
||||
return displayContent.getPendingTransaction();
|
||||
@@ -2465,7 +2476,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
}
|
||||
|
||||
final void updateSurfacePosition() {
|
||||
updateSurfacePosition(getPendingTransaction());
|
||||
updateSurfacePosition(getSyncTransaction());
|
||||
}
|
||||
|
||||
void updateSurfacePosition(Transaction t) {
|
||||
|
||||
@@ -5240,7 +5240,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
private void applyDims(Dimmer dimmer) {
|
||||
if (!mAnimatingExit && mAppDied) {
|
||||
mIsDimming = true;
|
||||
dimmer.dimAbove(getPendingTransaction(), this, DEFAULT_DIM_AMOUNT_DEAD_WINDOW);
|
||||
dimmer.dimAbove(getSyncTransaction(), this, DEFAULT_DIM_AMOUNT_DEAD_WINDOW);
|
||||
} else if ((mAttrs.flags & FLAG_DIM_BEHIND) != 0 && isVisibleNow() && !mHidden) {
|
||||
// Only show a dim behind when the following is satisfied:
|
||||
// 1. The window has the flag FLAG_DIM_BEHIND
|
||||
@@ -5248,7 +5248,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
// 3. The WS is considered visible according to the isVisible() method
|
||||
// 4. The WS is not hidden.
|
||||
mIsDimming = true;
|
||||
dimmer.dimBelow(getPendingTransaction(), this, mAttrs.dimAmount);
|
||||
dimmer.dimBelow(getSyncTransaction(), this, mAttrs.dimAmount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user