Loading services/core/java/com/android/server/wm/RecentsAnimationController.java +19 −3 Original line number Diff line number Diff line Loading @@ -111,7 +111,9 @@ public class RecentsAnimationController implements DeathRecipient { // minimized private boolean mSplitScreenMinimized; private Rect mTmpRect = new Rect(); private final Rect mTmpRect = new Rect(); private boolean mLinkedToDeathOfRunner; public interface RecentsAnimationCallbacks { void onAnimationFinished(@ReorderMode int reorderMode); Loading Loading @@ -267,7 +269,7 @@ public class RecentsAnimationController implements DeathRecipient { } try { mRunner.asBinder().linkToDeath(this, 0); linkToDeathOfRunner(); } catch (RemoteException e) { cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); return; Loading Loading @@ -393,7 +395,7 @@ public class RecentsAnimationController implements DeathRecipient { removeAnimation(taskAdapter); } mRunner.asBinder().unlinkToDeath(this, 0); unlinkToDeathOfRunner(); // Clear associated input consumers mService.mInputMonitor.updateInputWindowsLw(true /*force*/); mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION); Loading @@ -403,6 +405,20 @@ public class RecentsAnimationController implements DeathRecipient { mService.mH.postDelayed(mFailsafeRunnable, FAILSAFE_DELAY); } private void linkToDeathOfRunner() throws RemoteException { if (!mLinkedToDeathOfRunner) { mRunner.asBinder().linkToDeath(this, 0); mLinkedToDeathOfRunner = true; } } private void unlinkToDeathOfRunner() { if (mLinkedToDeathOfRunner) { mRunner.asBinder().unlinkToDeath(this, 0); mLinkedToDeathOfRunner = false; } } @Override public void binderDied() { cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); Loading services/core/java/com/android/server/wm/RemoteAnimationController.java +17 −2 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class RemoteAnimationController implements DeathRecipient { private FinishedCallback mFinishedCallback; private boolean mCanceled; private boolean mLinkedToDeathOfRunner; RemoteAnimationController(WindowManagerService service, RemoteAnimationAdapter remoteAnimationAdapter, Handler handler) { Loading Loading @@ -106,7 +107,7 @@ class RemoteAnimationController implements DeathRecipient { } mService.mAnimator.addAfterPrepareSurfacesRunnable(() -> { try { mRemoteAnimationAdapter.getRunner().asBinder().linkToDeath(this, 0); linkToDeathOfRunner(); mRemoteAnimationAdapter.getRunner().onAnimationStart(animations, mFinishedCallback); } catch (RemoteException e) { Slog.e(TAG, "Failed to start remote animation", e); Loading Loading @@ -164,8 +165,8 @@ class RemoteAnimationController implements DeathRecipient { private void onAnimationFinished() { mHandler.removeCallbacks(mTimeoutRunnable); mRemoteAnimationAdapter.getRunner().asBinder().unlinkToDeath(this, 0); synchronized (mService.mWindowMap) { unlinkToDeathOfRunner(); releaseFinishedCallback(); mService.openSurfaceTransaction(); try { Loading Loading @@ -204,6 +205,20 @@ class RemoteAnimationController implements DeathRecipient { mService.sendSetRunningRemoteAnimation(pid, running); } private void linkToDeathOfRunner() throws RemoteException { if (!mLinkedToDeathOfRunner) { mRemoteAnimationAdapter.getRunner().asBinder().linkToDeath(this, 0); mLinkedToDeathOfRunner = true; } } private void unlinkToDeathOfRunner() { if (mLinkedToDeathOfRunner) { mRemoteAnimationAdapter.getRunner().asBinder().unlinkToDeath(this, 0); mLinkedToDeathOfRunner = false; } } @Override public void binderDied() { cancelAnimation(); Loading Loading
services/core/java/com/android/server/wm/RecentsAnimationController.java +19 −3 Original line number Diff line number Diff line Loading @@ -111,7 +111,9 @@ public class RecentsAnimationController implements DeathRecipient { // minimized private boolean mSplitScreenMinimized; private Rect mTmpRect = new Rect(); private final Rect mTmpRect = new Rect(); private boolean mLinkedToDeathOfRunner; public interface RecentsAnimationCallbacks { void onAnimationFinished(@ReorderMode int reorderMode); Loading Loading @@ -267,7 +269,7 @@ public class RecentsAnimationController implements DeathRecipient { } try { mRunner.asBinder().linkToDeath(this, 0); linkToDeathOfRunner(); } catch (RemoteException e) { cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); return; Loading Loading @@ -393,7 +395,7 @@ public class RecentsAnimationController implements DeathRecipient { removeAnimation(taskAdapter); } mRunner.asBinder().unlinkToDeath(this, 0); unlinkToDeathOfRunner(); // Clear associated input consumers mService.mInputMonitor.updateInputWindowsLw(true /*force*/); mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION); Loading @@ -403,6 +405,20 @@ public class RecentsAnimationController implements DeathRecipient { mService.mH.postDelayed(mFailsafeRunnable, FAILSAFE_DELAY); } private void linkToDeathOfRunner() throws RemoteException { if (!mLinkedToDeathOfRunner) { mRunner.asBinder().linkToDeath(this, 0); mLinkedToDeathOfRunner = true; } } private void unlinkToDeathOfRunner() { if (mLinkedToDeathOfRunner) { mRunner.asBinder().unlinkToDeath(this, 0); mLinkedToDeathOfRunner = false; } } @Override public void binderDied() { cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); Loading
services/core/java/com/android/server/wm/RemoteAnimationController.java +17 −2 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class RemoteAnimationController implements DeathRecipient { private FinishedCallback mFinishedCallback; private boolean mCanceled; private boolean mLinkedToDeathOfRunner; RemoteAnimationController(WindowManagerService service, RemoteAnimationAdapter remoteAnimationAdapter, Handler handler) { Loading Loading @@ -106,7 +107,7 @@ class RemoteAnimationController implements DeathRecipient { } mService.mAnimator.addAfterPrepareSurfacesRunnable(() -> { try { mRemoteAnimationAdapter.getRunner().asBinder().linkToDeath(this, 0); linkToDeathOfRunner(); mRemoteAnimationAdapter.getRunner().onAnimationStart(animations, mFinishedCallback); } catch (RemoteException e) { Slog.e(TAG, "Failed to start remote animation", e); Loading Loading @@ -164,8 +165,8 @@ class RemoteAnimationController implements DeathRecipient { private void onAnimationFinished() { mHandler.removeCallbacks(mTimeoutRunnable); mRemoteAnimationAdapter.getRunner().asBinder().unlinkToDeath(this, 0); synchronized (mService.mWindowMap) { unlinkToDeathOfRunner(); releaseFinishedCallback(); mService.openSurfaceTransaction(); try { Loading Loading @@ -204,6 +205,20 @@ class RemoteAnimationController implements DeathRecipient { mService.sendSetRunningRemoteAnimation(pid, running); } private void linkToDeathOfRunner() throws RemoteException { if (!mLinkedToDeathOfRunner) { mRemoteAnimationAdapter.getRunner().asBinder().linkToDeath(this, 0); mLinkedToDeathOfRunner = true; } } private void unlinkToDeathOfRunner() { if (mLinkedToDeathOfRunner) { mRemoteAnimationAdapter.getRunner().asBinder().unlinkToDeath(this, 0); mLinkedToDeathOfRunner = false; } } @Override public void binderDied() { cancelAnimation(); Loading