blob: 87a7a740e18f02b84f36c2f8fa69ceb59a226cec [file] [log] [blame]
Winson Chunge2d72172018-01-25 17:46:20 +00001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package com.android.server.wm;
18
Jorim Jaggi54cff642018-03-15 15:51:32 +010019import static android.app.ActivityManagerInternal.APP_TRANSITION_RECENTS_ANIM;
Winson Chunge2d72172018-01-25 17:46:20 +000020import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
Jorim Jaggi54cff642018-03-15 15:51:32 +010021import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
Winson Chunge2d72172018-01-25 17:46:20 +000022import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
23import static android.view.RemoteAnimationTarget.MODE_CLOSING;
Winson Chunga89ffed2018-01-25 17:46:11 +000024import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
Winson Chunge2d72172018-01-25 17:46:20 +000025import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
26import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
27import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
Jorim Jaggi54cff642018-03-15 15:51:32 +010028import static com.android.server.wm.WindowManagerService.H.NOTIFY_APP_TRANSITION_STARTING;
Yi Jin6c6e9ca2018-03-20 16:53:35 -070029import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
30import static com.android.server.wm.AnimationAdapterProto.REMOTE;
Winson Chunge2d72172018-01-25 17:46:20 +000031
Winson Chunge2d72172018-01-25 17:46:20 +000032import android.app.ActivityManager.TaskSnapshot;
33import android.app.WindowConfiguration;
Winson Chunge2d72172018-01-25 17:46:20 +000034import android.graphics.Point;
35import android.graphics.Rect;
36import android.os.Binder;
37import android.os.RemoteException;
38import android.os.SystemClock;
Winson Chung23aa7b12018-02-01 11:41:43 -080039import android.util.ArraySet;
Winson Chunge2d72172018-01-25 17:46:20 +000040import android.util.Log;
Jorim Jaggif75d1612018-02-27 15:05:21 +010041import android.util.Slog;import android.util.proto.ProtoOutputStream;
Vadim Tryshev593e9562018-03-08 17:15:45 -080042import android.util.SparseBooleanArray;
Jorim Jaggi54cff642018-03-15 15:51:32 +010043import android.util.SparseIntArray;
Jorim Jaggif75d1612018-02-27 15:05:21 +010044import android.util.proto.ProtoOutputStream;
Winson Chunge2d72172018-01-25 17:46:20 +000045import android.view.IRecentsAnimationController;
46import android.view.IRecentsAnimationRunner;
47import android.view.RemoteAnimationTarget;
48import android.view.SurfaceControl;
49import android.view.SurfaceControl.Transaction;
Jorim Jaggif75d1612018-02-27 15:05:21 +010050
Winson Chung23aa7b12018-02-01 11:41:43 -080051import com.google.android.collect.Sets;
Jorim Jaggif75d1612018-02-27 15:05:21 +010052
53import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
Jorim Jaggi817ebdd2018-03-26 15:46:01 +020054import com.android.server.wm.utils.InsetUtils;
Jorim Jaggif75d1612018-02-27 15:05:21 +010055
Winson Chunge2d72172018-01-25 17:46:20 +000056import java.io.PrintWriter;
57import java.util.ArrayList;
Winson Chunge2d72172018-01-25 17:46:20 +000058/**
59 * Controls a single instance of the remote driven recents animation. In particular, this allows
60 * the calling SystemUI to animate the visible task windows as a part of the transition. The remote
61 * runner is provided an animation controller which allows it to take screenshots and to notify
62 * window manager when the animation is completed. In addition, window manager may also notify the
63 * app if it requires the animation to be canceled at any time (ie. due to timeout, etc.)
64 */
65public class RecentsAnimationController {
66 private static final String TAG = TAG_WITH_CLASS_NAME ? "RecentsAnimationController" : TAG_WM;
67 private static final boolean DEBUG = false;
68
69 private final WindowManagerService mService;
70 private final IRecentsAnimationRunner mRunner;
71 private final RecentsAnimationCallbacks mCallbacks;
72 private final ArrayList<TaskAnimationAdapter> mPendingAnimations = new ArrayList<>();
Winson Chungddf62972018-02-12 11:10:04 -080073 private final int mDisplayId;
Winson Chunge2d72172018-01-25 17:46:20 +000074
75 // The recents component app token that is shown behind the visibile tasks
76 private AppWindowToken mHomeAppToken;
Winson Chung584d6522018-02-07 23:57:38 +000077 private Rect mMinimizedHomeBounds = new Rect();
Winson Chunge2d72172018-01-25 17:46:20 +000078
79 // We start the RecentsAnimationController in a pending-start state since we need to wait for
80 // the wallpaper/activity to draw before we can give control to the handler to start animating
81 // the visible task surfaces
82 private boolean mPendingStart = true;
83
84 // Set when the animation has been canceled
85 private boolean mCanceled = false;
86
87 // Whether or not the input consumer is enabled. The input consumer must be both registered and
88 // enabled for it to start intercepting touch events.
89 private boolean mInputConsumerEnabled;
90
Winson Chunga89ffed2018-01-25 17:46:11 +000091 private Rect mTmpRect = new Rect();
92
Winson Chunge2d72172018-01-25 17:46:20 +000093 public interface RecentsAnimationCallbacks {
94 void onAnimationFinished(boolean moveHomeToTop);
95 }
96
97 private final IRecentsAnimationController mController =
98 new IRecentsAnimationController.Stub() {
99
100 @Override
101 public TaskSnapshot screenshotTask(int taskId) {
102 if (DEBUG) Log.d(TAG, "screenshotTask(" + taskId + "): mCanceled=" + mCanceled);
103 long token = Binder.clearCallingIdentity();
104 try {
105 synchronized (mService.getWindowManagerLock()) {
106 if (mCanceled) {
107 return null;
108 }
109 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
110 final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
111 final Task task = adapter.mTask;
112 if (task.mTaskId == taskId) {
Winson Chung23aa7b12018-02-01 11:41:43 -0800113 final TaskSnapshotController snapshotController =
114 mService.mTaskSnapshotController;
115 final ArraySet<Task> tasks = Sets.newArraySet(task);
116 snapshotController.snapshotTasks(tasks);
117 snapshotController.addSkipClosingAppSnapshotTasks(tasks);
118 return snapshotController.getSnapshot(taskId, 0 /* userId */,
119 false /* restoreFromDisk */, false /* reducedResolution */);
Winson Chunge2d72172018-01-25 17:46:20 +0000120 }
121 }
122 return null;
123 }
124 } finally {
125 Binder.restoreCallingIdentity(token);
126 }
127 }
128
129 @Override
130 public void finish(boolean moveHomeToTop) {
131 if (DEBUG) Log.d(TAG, "finish(" + moveHomeToTop + "): mCanceled=" + mCanceled);
132 long token = Binder.clearCallingIdentity();
133 try {
134 synchronized (mService.getWindowManagerLock()) {
135 if (mCanceled) {
136 return;
137 }
138 }
139
140 // Note, the callback will handle its own synchronization, do not lock on WM lock
141 // prior to calling the callback
142 mCallbacks.onAnimationFinished(moveHomeToTop);
143 } finally {
144 Binder.restoreCallingIdentity(token);
145 }
146 }
147
148 @Override
Jorim Jaggi50bf59c2018-03-09 17:29:48 +0100149 public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars)
150 throws RemoteException {
151 long token = Binder.clearCallingIdentity();
152 try {
153 synchronized (mService.getWindowManagerLock()) {
154 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
155 mPendingAnimations.get(i).mTask.setCanAffectSystemUiFlags(behindSystemBars);
156 }
157 mService.mWindowPlacerLocked.requestTraversal();
158 }
159 } finally {
160 Binder.restoreCallingIdentity(token);
161 }
162 }
163
164 @Override
Winson Chunge2d72172018-01-25 17:46:20 +0000165 public void setInputConsumerEnabled(boolean enabled) {
166 if (DEBUG) Log.d(TAG, "setInputConsumerEnabled(" + enabled + "): mCanceled="
167 + mCanceled);
168 long token = Binder.clearCallingIdentity();
169 try {
170 synchronized (mService.getWindowManagerLock()) {
171 if (mCanceled) {
172 return;
173 }
174
175 mInputConsumerEnabled = enabled;
176 mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
177 mService.scheduleAnimationLocked();
178 }
179 } finally {
180 Binder.restoreCallingIdentity(token);
181 }
182 }
183 };
184
185 /**
Winson Chunge2d72172018-01-25 17:46:20 +0000186 * @param remoteAnimationRunner The remote runner which should be notified when the animation is
187 * ready to start or has been canceled
188 * @param callbacks Callbacks to be made when the animation finishes
Winson Chunge2d72172018-01-25 17:46:20 +0000189 */
190 RecentsAnimationController(WindowManagerService service,
191 IRecentsAnimationRunner remoteAnimationRunner, RecentsAnimationCallbacks callbacks,
192 int displayId) {
193 mService = service;
194 mRunner = remoteAnimationRunner;
195 mCallbacks = callbacks;
Winson Chungddf62972018-02-12 11:10:04 -0800196 mDisplayId = displayId;
197 }
Winson Chunge2d72172018-01-25 17:46:20 +0000198
Winson Chungddf62972018-02-12 11:10:04 -0800199 /**
200 * Initializes the recents animation controller. This is a separate call from the constructor
201 * because it may call cancelAnimation() which needs to properly clean up the controller
202 * in the window manager.
203 */
Vadim Tryshev593e9562018-03-08 17:15:45 -0800204 public void initialize(SparseBooleanArray recentTaskIds) {
Winson Chunge2d72172018-01-25 17:46:20 +0000205 // Make leashes for each of the visible tasks and add it to the recents animation to be
206 // started
Winson Chungddf62972018-02-12 11:10:04 -0800207 final DisplayContent dc = mService.mRoot.getDisplayContent(mDisplayId);
208 final ArrayList<Task> visibleTasks = dc.getVisibleTasks();
Winson Chunge2d72172018-01-25 17:46:20 +0000209 final int taskCount = visibleTasks.size();
210 for (int i = 0; i < taskCount; i++) {
211 final Task task = visibleTasks.get(i);
212 final WindowConfiguration config = task.getWindowConfiguration();
213 if (config.tasksAreFloating()
214 || config.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
215 || config.getActivityType() == ACTIVITY_TYPE_HOME) {
216 continue;
217 }
Vadim Tryshev593e9562018-03-08 17:15:45 -0800218 addAnimation(task, !recentTaskIds.get(task.mTaskId));
Winson Chunge2d72172018-01-25 17:46:20 +0000219 }
220
Winson Chungddf62972018-02-12 11:10:04 -0800221 // Skip the animation if there is nothing to animate
222 if (mPendingAnimations.isEmpty()) {
223 cancelAnimation();
224 return;
225 }
226
Winson Chunge2d72172018-01-25 17:46:20 +0000227 // Adjust the wallpaper visibility for the showing home activity
228 final AppWindowToken recentsComponentAppToken =
229 dc.getHomeStack().getTopChild().getTopFullscreenAppToken();
230 if (recentsComponentAppToken != null) {
231 if (DEBUG) Log.d(TAG, "setHomeApp(" + recentsComponentAppToken.getName() + ")");
232 mHomeAppToken = recentsComponentAppToken;
Winson Chunge2d72172018-01-25 17:46:20 +0000233 if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) {
234 dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
235 dc.setLayoutNeeded();
236 }
237 }
238
Winson Chung584d6522018-02-07 23:57:38 +0000239 // Save the minimized home height
240 dc.getDockedDividerController().getHomeStackBoundsInDockedMode(mMinimizedHomeBounds);
241
Winson Chunge2d72172018-01-25 17:46:20 +0000242 mService.mWindowPlacerLocked.performSurfacePlacement();
243 }
244
Vadim Tryshev593e9562018-03-08 17:15:45 -0800245 private void addAnimation(Task task, boolean isRecentTaskInvisible) {
Winson Chunge2d72172018-01-25 17:46:20 +0000246 if (DEBUG) Log.d(TAG, "addAnimation(" + task.getName() + ")");
247 final SurfaceAnimator anim = new SurfaceAnimator(task, null /* animationFinishedCallback */,
Chavi Weingartenb736e322018-02-23 00:27:54 +0000248 mService);
Vadim Tryshev593e9562018-03-08 17:15:45 -0800249 final TaskAnimationAdapter taskAdapter = new TaskAnimationAdapter(task,
250 isRecentTaskInvisible);
Winson Chunge2d72172018-01-25 17:46:20 +0000251 anim.startAnimation(task.getPendingTransaction(), taskAdapter, false /* hidden */);
252 task.commitPendingTransaction();
253 mPendingAnimations.add(taskAdapter);
254 }
255
256 void startAnimation() {
Winson Chungddf62972018-02-12 11:10:04 -0800257 if (DEBUG) Log.d(TAG, "startAnimation(): mPendingStart=" + mPendingStart
258 + " mCanceled=" + mCanceled);
259 if (!mPendingStart || mCanceled) {
260 // Skip starting if we've already started or canceled the animation
Winson Chunge2d72172018-01-25 17:46:20 +0000261 return;
262 }
263 try {
Winson Chung2dc37362018-03-12 17:57:06 -0700264 final ArrayList<RemoteAnimationTarget> appAnimations = new ArrayList<>();
Winson Chunge2d72172018-01-25 17:46:20 +0000265 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
Winson Chung2dc37362018-03-12 17:57:06 -0700266 final RemoteAnimationTarget target =
267 mPendingAnimations.get(i).createRemoteAnimationApp();
268 if (target != null) {
269 appAnimations.add(target);
270 }
Winson Chunge2d72172018-01-25 17:46:20 +0000271 }
Winson Chung2dc37362018-03-12 17:57:06 -0700272 final RemoteAnimationTarget[] appTargets = appAnimations.toArray(
273 new RemoteAnimationTarget[appAnimations.size()]);
Winson Chunge2d72172018-01-25 17:46:20 +0000274 mPendingStart = false;
Winson Chung584d6522018-02-07 23:57:38 +0000275
276 final Rect minimizedHomeBounds =
277 mHomeAppToken != null && mHomeAppToken.inSplitScreenSecondaryWindowingMode()
278 ? mMinimizedHomeBounds : null;
279 final Rect contentInsets =
280 mHomeAppToken != null && mHomeAppToken.findMainWindow() != null
281 ? mHomeAppToken.findMainWindow().mContentInsets : null;
Winson Chung2dc37362018-03-12 17:57:06 -0700282 mRunner.onAnimationStart_New(mController, appTargets, contentInsets,
Winson Chung584d6522018-02-07 23:57:38 +0000283 minimizedHomeBounds);
Winson Chunge2d72172018-01-25 17:46:20 +0000284 } catch (RemoteException e) {
285 Slog.e(TAG, "Failed to start recents animation", e);
286 }
Jorim Jaggi54cff642018-03-15 15:51:32 +0100287 final SparseIntArray reasons = new SparseIntArray();
288 reasons.put(WINDOWING_MODE_FULLSCREEN, APP_TRANSITION_RECENTS_ANIM);
289 mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING,
290 reasons).sendToTarget();
Winson Chunge2d72172018-01-25 17:46:20 +0000291 }
292
293 void cancelAnimation() {
294 if (DEBUG) Log.d(TAG, "cancelAnimation()");
Winson Chung65fc89a2018-02-28 08:32:12 -0800295 synchronized (mService.getWindowManagerLock()) {
296 if (mCanceled) {
297 // We've already canceled the animation
298 return;
299 }
300 mCanceled = true;
301 try {
302 mRunner.onAnimationCanceled();
303 } catch (RemoteException e) {
304 Slog.e(TAG, "Failed to cancel recents animation", e);
305 }
Winson Chunge2d72172018-01-25 17:46:20 +0000306 }
Winson Chunge2d72172018-01-25 17:46:20 +0000307 // Clean up and return to the previous app
Winson Chung65fc89a2018-02-28 08:32:12 -0800308 // Don't hold the WM lock here as it calls back to AM/RecentsAnimation
Winson Chunge2d72172018-01-25 17:46:20 +0000309 mCallbacks.onAnimationFinished(false /* moveHomeToTop */);
310 }
311
312 void cleanupAnimation() {
313 if (DEBUG) Log.d(TAG, "cleanupAnimation(): mPendingAnimations="
314 + mPendingAnimations.size());
315 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
316 final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
Jorim Jaggi50bf59c2018-03-09 17:29:48 +0100317 adapter.mTask.setCanAffectSystemUiFlags(true);
Winson Chunge2d72172018-01-25 17:46:20 +0000318 adapter.mCapturedFinishCallback.onAnimationFinished(adapter);
319 }
320 mPendingAnimations.clear();
321
322 mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
Winson Chunga89ffed2018-01-25 17:46:11 +0000323 mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION);
Winson Chunge2d72172018-01-25 17:46:20 +0000324 }
325
326 void checkAnimationReady(WallpaperController wallpaperController) {
327 if (mPendingStart) {
328 final boolean wallpaperReady = !isHomeAppOverWallpaper()
329 || (wallpaperController.getWallpaperTarget() != null
330 && wallpaperController.wallpaperTransitionReady());
331 if (wallpaperReady) {
332 mService.getRecentsAnimationController().startAnimation();
333 }
334 }
335 }
336
337 boolean isWallpaperVisible(WindowState w) {
338 return w != null && w.mAppToken != null && mHomeAppToken == w.mAppToken
339 && isHomeAppOverWallpaper();
340 }
341
Winson Chunga89ffed2018-01-25 17:46:11 +0000342 boolean hasInputConsumerForApp(AppWindowToken appToken) {
343 return mInputConsumerEnabled && isAnimatingApp(appToken);
344 }
345
346 boolean updateInputConsumerForApp(InputConsumerImpl recentsAnimationInputConsumer,
347 boolean hasFocus) {
348 // Update the input consumer touchable region to match the home app main window
349 final WindowState homeAppMainWindow = mHomeAppToken != null
350 ? mHomeAppToken.findMainWindow()
351 : null;
352 if (homeAppMainWindow != null) {
353 homeAppMainWindow.getBounds(mTmpRect);
354 recentsAnimationInputConsumer.mWindowHandle.hasFocus = hasFocus;
355 recentsAnimationInputConsumer.mWindowHandle.touchableRegion.set(mTmpRect);
356 return true;
357 }
358 return false;
359 }
360
361 private boolean isHomeAppOverWallpaper() {
Winson Chunge2d72172018-01-25 17:46:20 +0000362 if (mHomeAppToken == null) {
363 return false;
364 }
365 return mHomeAppToken.windowsCanBeWallpaperTarget();
366 }
367
Winson Chunga89ffed2018-01-25 17:46:11 +0000368 private boolean isAnimatingApp(AppWindowToken appToken) {
Winson Chunge2d72172018-01-25 17:46:20 +0000369 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
370 final Task task = mPendingAnimations.get(i).mTask;
371 for (int j = task.getChildCount() - 1; j >= 0; j--) {
372 final AppWindowToken app = task.getChildAt(j);
373 if (app == appToken) {
374 return true;
375 }
376 }
377 }
378 return false;
379 }
380
Winson Chunge2d72172018-01-25 17:46:20 +0000381 private class TaskAnimationAdapter implements AnimationAdapter {
382
Vadim Tryshev593e9562018-03-08 17:15:45 -0800383 private final Task mTask;
Winson Chunge2d72172018-01-25 17:46:20 +0000384 private SurfaceControl mCapturedLeash;
385 private OnAnimationFinishedCallback mCapturedFinishCallback;
Vadim Tryshev593e9562018-03-08 17:15:45 -0800386 private final boolean mIsRecentTaskInvisible;
Jorim Jaggif75d1612018-02-27 15:05:21 +0100387 private RemoteAnimationTarget mTarget;
Winson Chunge2d72172018-01-25 17:46:20 +0000388
Vadim Tryshev593e9562018-03-08 17:15:45 -0800389 TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
Winson Chunge2d72172018-01-25 17:46:20 +0000390 mTask = task;
Vadim Tryshev593e9562018-03-08 17:15:45 -0800391 mIsRecentTaskInvisible = isRecentTaskInvisible;
Winson Chunge2d72172018-01-25 17:46:20 +0000392 }
393
394 RemoteAnimationTarget createRemoteAnimationApp() {
Winson Chung584d6522018-02-07 23:57:38 +0000395 final Point position = new Point();
396 final Rect bounds = new Rect();
397 final WindowContainer container = mTask.getParent();
398 container.getRelativePosition(position);
399 container.getBounds(bounds);
400 final WindowState mainWindow = mTask.getTopVisibleAppMainWindow();
Winson Chung2dc37362018-03-12 17:57:06 -0700401 if (mainWindow == null) {
402 return null;
403 }
Jorim Jaggi817ebdd2018-03-26 15:46:01 +0200404 final Rect insets = new Rect(mainWindow.mContentInsets);
405 InsetUtils.addInsets(insets, mainWindow.mAppToken.getLetterboxInsets());
Jorim Jaggif75d1612018-02-27 15:05:21 +0100406 mTarget = new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash,
Winson Chung584d6522018-02-07 23:57:38 +0000407 !mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
Jorim Jaggi817ebdd2018-03-26 15:46:01 +0200408 insets, mTask.getPrefixOrderIndex(), position, bounds,
Vadim Tryshev593e9562018-03-08 17:15:45 -0800409 mTask.getWindowConfiguration(), mIsRecentTaskInvisible);
Jorim Jaggif75d1612018-02-27 15:05:21 +0100410 return mTarget;
Winson Chunge2d72172018-01-25 17:46:20 +0000411 }
412
413 @Override
414 public boolean getDetachWallpaper() {
415 return false;
416 }
417
418 @Override
Jorim Jaggi82c17862018-02-21 17:50:18 +0100419 public boolean getShowWallpaper() {
420 return false;
421 }
422
423 @Override
Winson Chunge2d72172018-01-25 17:46:20 +0000424 public int getBackgroundColor() {
425 return 0;
426 }
427
428 @Override
429 public void startAnimation(SurfaceControl animationLeash, Transaction t,
430 OnAnimationFinishedCallback finishCallback) {
431 mCapturedLeash = animationLeash;
432 mCapturedFinishCallback = finishCallback;
433 }
434
435 @Override
436 public void onAnimationCancelled(SurfaceControl animationLeash) {
437 cancelAnimation();
438 }
439
440 @Override
441 public long getDurationHint() {
442 return 0;
443 }
444
445 @Override
446 public long getStatusBarTransitionsStartTime() {
447 return SystemClock.uptimeMillis();
448 }
Jorim Jaggif75d1612018-02-27 15:05:21 +0100449
450 @Override
451 public void dump(PrintWriter pw, String prefix) {
452 pw.print(prefix); pw.println("task=" + mTask);
453 if (mTarget != null) {
454 pw.print(prefix); pw.println("Target:");
455 mTarget.dump(pw, prefix + " ");
456 } else {
457 pw.print(prefix); pw.println("Target: null");
458 }
459 }
460
461 @Override
462 public void writeToProto(ProtoOutputStream proto) {
463 final long token = proto.start(REMOTE);
464 if (mTarget != null) {
465 mTarget.writeToProto(proto, TARGET);
466 }
467 proto.end(token);
468 }
Winson Chunge2d72172018-01-25 17:46:20 +0000469 }
470
471 public void dump(PrintWriter pw, String prefix) {
472 final String innerPrefix = prefix + " ";
473 pw.print(prefix); pw.println(RecentsAnimationController.class.getSimpleName() + ":");
474 pw.print(innerPrefix); pw.println("mPendingStart=" + mPendingStart);
475 pw.print(innerPrefix); pw.println("mHomeAppToken=" + mHomeAppToken);
476 }
477}