Loading core/java/android/view/IRecentsAnimationController.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ import android.graphics.GraphicBuffer; import android.window.PictureInPictureSurfaceTransaction; import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.os.IResultReceiver; /** /** * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the * runner control certain aspects of the recents animation, and to notify window manager when the * runner control certain aspects of the recents animation, and to notify window manager when the Loading Loading @@ -58,7 +60,7 @@ interface IRecentsAnimationController { * top resumed app, false otherwise. * top resumed app, false otherwise. */ */ @UnsupportedAppUsage @UnsupportedAppUsage void finish(boolean moveHomeToTop, boolean sendUserLeaveHint); void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, in IResultReceiver finishCb); /** /** * Called by the handler to indicate that the recents animation input consumer should be * Called by the handler to indicate that the recents animation input consumer should be Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +19 −6 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import android.window.WindowContainerTransaction; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.IResultReceiver; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.protolog.common.ProtoLog; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.protolog.ShellProtoLogGroup; import com.android.wm.shell.protolog.ShellProtoLogGroup; Loading Loading @@ -279,7 +280,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { mDeathHandler = () -> { mDeathHandler = () -> { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.DeathRecipient: binder died", mInstanceId); "[%d] RecentsController.DeathRecipient: binder died", mInstanceId); finish(mWillFinishToHome, false /* leaveHint */); finish(mWillFinishToHome, false /* leaveHint */, null /* finishCb */); }; }; try { try { mListener.asBinder().linkToDeath(mDeathHandler, 0 /* flags */); mListener.asBinder().linkToDeath(mDeathHandler, 0 /* flags */); Loading Loading @@ -313,7 +314,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { } } } } if (mFinishCB != null) { if (mFinishCB != null) { finishInner(toHome, false /* userLeave */); finishInner(toHome, false /* userLeave */, null /* finishCb */); } else { } else { cleanUp(); cleanUp(); } } Loading Loading @@ -670,7 +671,8 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { // now and let it do its animation (since recents is going to be occluded). // now and let it do its animation (since recents is going to be occluded). sendCancelWithSnapshots(); sendCancelWithSnapshots(); mExecutor.executeDelayed( mExecutor.executeDelayed( () -> finishInner(true /* toHome */, false /* userLeaveHint */), 0); () -> finishInner(true /* toHome */, false /* userLeaveHint */, null /* finishCb */), 0); return; return; } } if (recentsOpening != null) { if (recentsOpening != null) { Loading Loading @@ -899,11 +901,12 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { @Override @Override @SuppressLint("NewApi") @SuppressLint("NewApi") public void finish(boolean toHome, boolean sendUserLeaveHint) { public void finish(boolean toHome, boolean sendUserLeaveHint, IResultReceiver finishCb) { mExecutor.execute(() -> finishInner(toHome, sendUserLeaveHint)); mExecutor.execute(() -> finishInner(toHome, sendUserLeaveHint, finishCb)); } } private void finishInner(boolean toHome, boolean sendUserLeaveHint) { private void finishInner(boolean toHome, boolean sendUserLeaveHint, IResultReceiver runnerFinishCb) { if (mFinishCB == null) { if (mFinishCB == null) { Slog.e(TAG, "Duplicate call to finish"); Slog.e(TAG, "Duplicate call to finish"); return; return; Loading Loading @@ -993,6 +996,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { } } cleanUp(); cleanUp(); finishCB.onTransitionFinished(wct.isEmpty() ? null : wct); finishCB.onTransitionFinished(wct.isEmpty() ? null : wct); if (runnerFinishCb != null) { try { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.finishInner: calling finish callback", mInstanceId); runnerFinishCb.send(0, null); } catch (RemoteException e) { Slog.e(TAG, "Failed to report transition finished", e); } } } } @Override @Override Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.SurfaceControl; import android.window.PictureInPictureSurfaceTransaction; import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.os.IResultReceiver; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.recents.model.ThumbnailData; public class RecentsAnimationControllerCompat { public class RecentsAnimationControllerCompat { Loading Loading @@ -89,11 +90,16 @@ public class RecentsAnimationControllerCompat { * @param sendUserLeaveHint determines whether userLeaveHint will be set true to the previous * @param sendUserLeaveHint determines whether userLeaveHint will be set true to the previous * app. * app. */ */ public void finish(boolean toHome, boolean sendUserLeaveHint) { public void finish(boolean toHome, boolean sendUserLeaveHint, IResultReceiver finishCb) { try { try { mAnimationController.finish(toHome, sendUserLeaveHint); mAnimationController.finish(toHome, sendUserLeaveHint, finishCb); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG, "Failed to finish recents animation", e); Log.e(TAG, "Failed to finish recents animation", e); try { finishCb.send(0, null); } catch (Exception ex) { // Local call, can ignore } } } } } Loading services/core/java/com/android/server/wm/RecentsAnimationController.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.IResultReceiver; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.protolog.common.ProtoLog; import com.android.server.LocalServices; import com.android.server.LocalServices; import com.android.server.inputmethod.InputMethodManagerInternal; import com.android.server.inputmethod.InputMethodManagerInternal; Loading Loading @@ -244,7 +245,8 @@ public class RecentsAnimationController implements DeathRecipient { } } @Override @Override public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint) { public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, IResultReceiver finishCb) { ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled); "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled); final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity(); Loading @@ -257,6 +259,13 @@ public class RecentsAnimationController implements DeathRecipient { } finally { } finally { Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token); } } if (finishCb != null) { try { finishCb.send(0, new Bundle()); } catch (RemoteException e) { Slog.e(TAG, "Failed to report animation finished", e); } } } } @Override @Override Loading Loading
core/java/android/view/IRecentsAnimationController.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ import android.graphics.GraphicBuffer; import android.window.PictureInPictureSurfaceTransaction; import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.os.IResultReceiver; /** /** * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the * runner control certain aspects of the recents animation, and to notify window manager when the * runner control certain aspects of the recents animation, and to notify window manager when the Loading Loading @@ -58,7 +60,7 @@ interface IRecentsAnimationController { * top resumed app, false otherwise. * top resumed app, false otherwise. */ */ @UnsupportedAppUsage @UnsupportedAppUsage void finish(boolean moveHomeToTop, boolean sendUserLeaveHint); void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, in IResultReceiver finishCb); /** /** * Called by the handler to indicate that the recents animation input consumer should be * Called by the handler to indicate that the recents animation input consumer should be Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +19 −6 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import android.window.WindowContainerTransaction; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.IResultReceiver; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.protolog.common.ProtoLog; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.protolog.ShellProtoLogGroup; import com.android.wm.shell.protolog.ShellProtoLogGroup; Loading Loading @@ -279,7 +280,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { mDeathHandler = () -> { mDeathHandler = () -> { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.DeathRecipient: binder died", mInstanceId); "[%d] RecentsController.DeathRecipient: binder died", mInstanceId); finish(mWillFinishToHome, false /* leaveHint */); finish(mWillFinishToHome, false /* leaveHint */, null /* finishCb */); }; }; try { try { mListener.asBinder().linkToDeath(mDeathHandler, 0 /* flags */); mListener.asBinder().linkToDeath(mDeathHandler, 0 /* flags */); Loading Loading @@ -313,7 +314,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { } } } } if (mFinishCB != null) { if (mFinishCB != null) { finishInner(toHome, false /* userLeave */); finishInner(toHome, false /* userLeave */, null /* finishCb */); } else { } else { cleanUp(); cleanUp(); } } Loading Loading @@ -670,7 +671,8 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { // now and let it do its animation (since recents is going to be occluded). // now and let it do its animation (since recents is going to be occluded). sendCancelWithSnapshots(); sendCancelWithSnapshots(); mExecutor.executeDelayed( mExecutor.executeDelayed( () -> finishInner(true /* toHome */, false /* userLeaveHint */), 0); () -> finishInner(true /* toHome */, false /* userLeaveHint */, null /* finishCb */), 0); return; return; } } if (recentsOpening != null) { if (recentsOpening != null) { Loading Loading @@ -899,11 +901,12 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { @Override @Override @SuppressLint("NewApi") @SuppressLint("NewApi") public void finish(boolean toHome, boolean sendUserLeaveHint) { public void finish(boolean toHome, boolean sendUserLeaveHint, IResultReceiver finishCb) { mExecutor.execute(() -> finishInner(toHome, sendUserLeaveHint)); mExecutor.execute(() -> finishInner(toHome, sendUserLeaveHint, finishCb)); } } private void finishInner(boolean toHome, boolean sendUserLeaveHint) { private void finishInner(boolean toHome, boolean sendUserLeaveHint, IResultReceiver runnerFinishCb) { if (mFinishCB == null) { if (mFinishCB == null) { Slog.e(TAG, "Duplicate call to finish"); Slog.e(TAG, "Duplicate call to finish"); return; return; Loading Loading @@ -993,6 +996,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { } } cleanUp(); cleanUp(); finishCB.onTransitionFinished(wct.isEmpty() ? null : wct); finishCB.onTransitionFinished(wct.isEmpty() ? null : wct); if (runnerFinishCb != null) { try { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "[%d] RecentsController.finishInner: calling finish callback", mInstanceId); runnerFinishCb.send(0, null); } catch (RemoteException e) { Slog.e(TAG, "Failed to report transition finished", e); } } } } @Override @Override Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.SurfaceControl; import android.window.PictureInPictureSurfaceTransaction; import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.os.IResultReceiver; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.recents.model.ThumbnailData; public class RecentsAnimationControllerCompat { public class RecentsAnimationControllerCompat { Loading Loading @@ -89,11 +90,16 @@ public class RecentsAnimationControllerCompat { * @param sendUserLeaveHint determines whether userLeaveHint will be set true to the previous * @param sendUserLeaveHint determines whether userLeaveHint will be set true to the previous * app. * app. */ */ public void finish(boolean toHome, boolean sendUserLeaveHint) { public void finish(boolean toHome, boolean sendUserLeaveHint, IResultReceiver finishCb) { try { try { mAnimationController.finish(toHome, sendUserLeaveHint); mAnimationController.finish(toHome, sendUserLeaveHint, finishCb); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG, "Failed to finish recents animation", e); Log.e(TAG, "Failed to finish recents animation", e); try { finishCb.send(0, null); } catch (Exception ex) { // Local call, can ignore } } } } } Loading
services/core/java/com/android/server/wm/RecentsAnimationController.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ import android.window.PictureInPictureSurfaceTransaction; import android.window.TaskSnapshot; import android.window.TaskSnapshot; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.IResultReceiver; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.protolog.common.ProtoLog; import com.android.server.LocalServices; import com.android.server.LocalServices; import com.android.server.inputmethod.InputMethodManagerInternal; import com.android.server.inputmethod.InputMethodManagerInternal; Loading Loading @@ -244,7 +245,8 @@ public class RecentsAnimationController implements DeathRecipient { } } @Override @Override public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint) { public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint, IResultReceiver finishCb) { ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled); "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled); final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity(); Loading @@ -257,6 +259,13 @@ public class RecentsAnimationController implements DeathRecipient { } finally { } finally { Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token); } } if (finishCb != null) { try { finishCb.send(0, new Bundle()); } catch (RemoteException e) { Slog.e(TAG, "Failed to report animation finished", e); } } } } @Override @Override Loading