Fix recents not working on NothingOS 2.6 (#4940)

Pull #4417 implemented this incompletely, resulting in breakage in
NothingOS 2.6.

Transaction needs to be applied so that the animation chain can
continue.

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park
2024-10-28 11:25:06 +09:00
committed by GitHub
parent 9c1d53f9cf
commit 1aba5ab289
4 changed files with 43 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ import android.os.Handler;
import android.os.RemoteException;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
import androidx.annotation.BinderThread;
import androidx.annotation.Nullable;
@@ -102,6 +104,22 @@ public class LauncherAnimationRunner extends RemoteAnimationRunnerCompat {
}
}
// Introduced in NothingOS 2.5.5, needed in 2.6
@BinderThread
public void onAnimationStartWithSurfaceTransaction(
int transit,
TransitionInfo transitionInfo,
SurfaceControl.Transaction transaction,
RemoteAnimationTarget[] appTargets,
RemoteAnimationTarget[] wallpaperTargets,
RemoteAnimationTarget[] nonAppTargets,
Runnable runnable) {
if (transaction != null) {
transaction.apply();
}
onAnimationStart(transit, appTargets, wallpaperTargets, nonAppTargets, runnable);
}
private RemoteAnimationFactory getFactory() {
RemoteAnimationFactory factory = mFactory.get();
return factory != null ? factory : DEFAULT_FACTORY;

View File

@@ -25,6 +25,8 @@ import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent
import android.graphics.Rect;
import android.util.ArraySet;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
import androidx.annotation.BinderThread;
import androidx.annotation.NonNull;
@@ -99,6 +101,18 @@ public class RecentsAnimationCallbacks implements
homeContentInsets, minimizedHomeBounds);
}
// Introduced in NothingOS 2.5.5, needed in 2.6
@BinderThread
public final void onAnimationStart(RecentsAnimationControllerCompat controller,
TransitionInfo transitionInfo, SurfaceControl.Transaction transaction,
RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers,
Rect homeContentInsets, Rect minimizedHomeBounds) {
if (transaction != null) {
transaction.apply();
}
onAnimationStart(controller, apps, wallpapers, homeContentInsets, minimizedHomeBounds);
}
// Called only in R+ platform
@BinderThread
public final void onAnimationStart(RecentsAnimationControllerCompat animationController,

View File

@@ -1489,8 +1489,9 @@ public class SystemUiProxy implements ISystemUiProxy {
RemoteAnimationTarget[] wallpapers,
Rect homeContentInsets,
Rect minimizedHomeBounds) {
listener.onAnimationStart(new RecentsAnimationControllerCompat(controller), apps,
wallpapers, homeContentInsets, minimizedHomeBounds);
listener.onAnimationStart(new RecentsAnimationControllerCompat(controller),
transitionInfo, transaction, apps, wallpapers,
homeContentInsets, minimizedHomeBounds);
}
@Override