Loading quickstep/src/com/android/quickstep/LauncherBackAnimationController.java +32 −26 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.quickstep.util.RectFSpringAnim; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; /** * Controls the animation of swiping back and returning to launcher. * Loading Loading @@ -87,6 +88,7 @@ public class LauncherBackAnimationController { private boolean mAnimatorSetInProgress = false; private float mBackProgress = 0; private boolean mBackInProgress = false; private IOnBackInvokedCallback mBackCallback; public LauncherBackAnimationController( BaseQuickstepLauncher launcher, Loading @@ -112,8 +114,7 @@ public class LauncherBackAnimationController { * @param handler Handler to the thread to run the animations on. */ public void registerBackCallbacks(Handler handler) { SystemUiProxy.INSTANCE.get(mLauncher).setBackToLauncherCallback( new IOnBackInvokedCallback.Stub() { mBackCallback = new IOnBackInvokedCallback.Stub() { @Override public void onBackCancelled() { handler.post(() -> resetPositionAnimated()); Loading @@ -138,8 +139,10 @@ public class LauncherBackAnimationController { } } @Override public void onBackStarted() { } }); }; SystemUiProxy.INSTANCE.get(mLauncher).setBackToLauncherCallback(mBackCallback); } private void resetPositionAnimated() { Loading @@ -162,7 +165,10 @@ public class LauncherBackAnimationController { /** Unregisters the back to launcher callback in shell. */ public void unregisterBackCallbacks() { SystemUiProxy.INSTANCE.get(mLauncher).clearBackToLauncherCallback(); if (mBackCallback != null) { SystemUiProxy.INSTANCE.get(mLauncher).clearBackToLauncherCallback(mBackCallback); } mBackCallback = null; } private void startBack(BackEvent backEvent) { Loading quickstep/src/com/android/quickstep/SystemUiProxy.java +8 −2 Original line number Diff line number Diff line Loading @@ -847,8 +847,14 @@ public class SystemUiProxy implements ISystemUiProxy, DisplayController.DisplayI } } /** Clears the previously registered {@link IOnBackInvokedCallback}. */ public void clearBackToLauncherCallback() { /** Clears the previously registered {@link IOnBackInvokedCallback}. * * @param callback The previously registered callback instance. */ public void clearBackToLauncherCallback(IOnBackInvokedCallback callback) { if (mBackToLauncherCallback != callback) { return; } mBackToLauncherCallback = null; if (mBackAnimation == null) { return; Loading Loading
quickstep/src/com/android/quickstep/LauncherBackAnimationController.java +32 −26 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import com.android.quickstep.util.RectFSpringAnim; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; /** * Controls the animation of swiping back and returning to launcher. * Loading Loading @@ -87,6 +88,7 @@ public class LauncherBackAnimationController { private boolean mAnimatorSetInProgress = false; private float mBackProgress = 0; private boolean mBackInProgress = false; private IOnBackInvokedCallback mBackCallback; public LauncherBackAnimationController( BaseQuickstepLauncher launcher, Loading @@ -112,8 +114,7 @@ public class LauncherBackAnimationController { * @param handler Handler to the thread to run the animations on. */ public void registerBackCallbacks(Handler handler) { SystemUiProxy.INSTANCE.get(mLauncher).setBackToLauncherCallback( new IOnBackInvokedCallback.Stub() { mBackCallback = new IOnBackInvokedCallback.Stub() { @Override public void onBackCancelled() { handler.post(() -> resetPositionAnimated()); Loading @@ -138,8 +139,10 @@ public class LauncherBackAnimationController { } } @Override public void onBackStarted() { } }); }; SystemUiProxy.INSTANCE.get(mLauncher).setBackToLauncherCallback(mBackCallback); } private void resetPositionAnimated() { Loading @@ -162,7 +165,10 @@ public class LauncherBackAnimationController { /** Unregisters the back to launcher callback in shell. */ public void unregisterBackCallbacks() { SystemUiProxy.INSTANCE.get(mLauncher).clearBackToLauncherCallback(); if (mBackCallback != null) { SystemUiProxy.INSTANCE.get(mLauncher).clearBackToLauncherCallback(mBackCallback); } mBackCallback = null; } private void startBack(BackEvent backEvent) { Loading
quickstep/src/com/android/quickstep/SystemUiProxy.java +8 −2 Original line number Diff line number Diff line Loading @@ -847,8 +847,14 @@ public class SystemUiProxy implements ISystemUiProxy, DisplayController.DisplayI } } /** Clears the previously registered {@link IOnBackInvokedCallback}. */ public void clearBackToLauncherCallback() { /** Clears the previously registered {@link IOnBackInvokedCallback}. * * @param callback The previously registered callback instance. */ public void clearBackToLauncherCallback(IOnBackInvokedCallback callback) { if (mBackToLauncherCallback != callback) { return; } mBackToLauncherCallback = null; if (mBackAnimation == null) { return; Loading