Fixes for SyncRtSurfaceTransactionApplier

Such that launcher can use it.

Test: Open/close app
Bug: 78611607
Change-Id: I8e66b983035eb8da9dd8349e2a5b57d3631df74f
This commit is contained in:
Jorim Jaggi
2018-05-18 18:23:08 +02:00
parent e4a8d4c7e9
commit 42b0475097
2 changed files with 9 additions and 5 deletions

View File

@@ -70,6 +70,9 @@ public class SyncRtSurfaceTransactionApplier {
t.setEarlyWakeup();
t.apply();
});
// Make sure a frame gets scheduled.
mTargetViewRootImpl.getView().invalidate();
}
public static class SurfaceParams {
@@ -83,9 +86,9 @@ public class SyncRtSurfaceTransactionApplier {
* @param matrix Matrix to apply.
* @param windowCrop Crop to apply.
*/
public SurfaceParams(SurfaceControl surface, float alpha, Matrix matrix, Rect windowCrop,
int layer) {
this.surface = surface;
public SurfaceParams(SurfaceControlCompat surface, float alpha, Matrix matrix,
Rect windowCrop, int layer) {
this.surface = surface.mSurfaceControl;
this.alpha = alpha;
this.matrix = new Matrix(matrix);
this.windowCrop = new Rect(windowCrop);

View File

@@ -30,6 +30,7 @@ import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import com.android.systemui.Interpolators;
import com.android.systemui.shared.system.SurfaceControlCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplier.SurfaceParams;
import com.android.systemui.statusbar.ExpandableNotificationRow;
@@ -245,8 +246,8 @@ public class ActivityLaunchAnimator {
Matrix m = new Matrix();
m.postTranslate(0, (float) (mParams.top - app.position.y));
mWindowCrop.set(mParams.left, 0, mParams.right, mParams.getHeight());
SurfaceParams params = new SurfaceParams(app.leash, 1f /* alpha */, m, mWindowCrop,
app.prefixOrderIndex);
SurfaceParams params = new SurfaceParams(new SurfaceControlCompat(app.leash),
1f /* alpha */, m, mWindowCrop, app.prefixOrderIndex);
mSyncRtTransactionApplier.scheduleApply(params);
}