Skip to content

Commit

Permalink
Catch RemoteAnimationTarget.rotationChange (LawnchairLauncher#3776)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored and validcube committed Dec 15, 2023
1 parent a815252 commit 4831ef8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1238,9 +1238,12 @@ public void onAnimationStart(Animator animation) {

private static int getRotationChange(RemoteAnimationTargetCompat[] appTargets) {
int rotationChange = 0;
for (RemoteAnimationTargetCompat target : appTargets) {
if (Math.abs(target.rotationChange) > Math.abs(rotationChange)) {
rotationChange = target.rotationChange;
for (RemoteAnimationTarget target : appTargets) {
try {
if (Math.abs(target.rotationChange) > Math.abs(rotationChange)) {
rotationChange = target.rotationChange;
}
} catch (NoSuchFieldError ignored) {
}
}
return rotationChange;
Expand Down
17 changes: 11 additions & 6 deletions quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1375,13 +1375,18 @@ public void onAnimationSuccess(Animator animator) {
}
}

private int calculateWindowRotation(RemoteAnimationTargetCompat runningTaskTarget,
RecentsOrientedState orientationState) {
if (runningTaskTarget.rotationChange != 0
private int calculateWindowRotation(RemoteAnimationTarget runningTaskTarget,
RecentsOrientedState orientationState) {
try {
if (runningTaskTarget.rotationChange != 0
&& TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
return Math.abs(runningTaskTarget.rotationChange) == ROTATION_90
? ROTATION_270 : ROTATION_90;
} else {
return Math.abs(runningTaskTarget.rotationChange) == ROTATION_90
? ROTATION_270
: ROTATION_90;
} else {
return orientationState.getDisplayRotation();
}
} catch (NoSuchFieldError ignored) {
return orientationState.getDisplayRotation();
}
}
Expand Down

0 comments on commit 4831ef8

Please sign in to comment.