blob: 8f8e366d002cc78ba2cb8db102ba7444e5bbd859 [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;
Winson Chunge2d72172018-01-25 17:46:20 +000044import android.view.IRecentsAnimationController;
45import android.view.IRecentsAnimationRunner;
46import android.view.RemoteAnimationTarget;
47import android.view.SurfaceControl;
48import android.view.SurfaceControl.Transaction;
Jorim Jaggif75d1612018-02-27 15:05:21 +010049
Winson Chung23aa7b12018-02-01 11:41:43 -080050import com.google.android.collect.Sets;
Jorim Jaggif75d1612018-02-27 15:05:21 +010051
52import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
53
Winson Chunge2d72172018-01-25 17:46:20 +000054import java.io.PrintWriter;
55import java.util.ArrayList;
Winson Chunge2d72172018-01-25 17:46:20 +000056/**
57 * Controls a single instance of the remote driven recents animation. In particular, this allows
58 * the calling SystemUI to animate the visible task windows as a part of the transition. The remote
59 * runner is provided an animation controller which allows it to take screenshots and to notify
60 * window manager when the animation is completed. In addition, window manager may also notify the
61 * app if it requires the animation to be canceled at any time (ie. due to timeout, etc.)
62 */
63public class RecentsAnimationController {
64 private static final String TAG = TAG_WITH_CLASS_NAME ? "RecentsAnimationController" : TAG_WM;
65 private static final boolean DEBUG = false;
66
67 private final WindowManagerService mService;
68 private final IRecentsAnimationRunner mRunner;
69 private final RecentsAnimationCallbacks mCallbacks;
70 private final ArrayList<TaskAnimationAdapter> mPendingAnimations = new ArrayList<>();
Winson Chungddf62972018-02-12 11:10:04 -080071 private final int mDisplayId;
Winson Chunge2d72172018-01-25 17:46:20 +000072
73 // The recents component app token that is shown behind the visibile tasks
74 private AppWindowToken mHomeAppToken;
Winson Chung584d6522018-02-07 23:57:38 +000075 private Rect mMinimizedHomeBounds = new Rect();
Winson Chunge2d72172018-01-25 17:46:20 +000076
77 // We start the RecentsAnimationController in a pending-start state since we need to wait for
78 // the wallpaper/activity to draw before we can give control to the handler to start animating
79 // the visible task surfaces
80 private boolean mPendingStart = true;
81
82 // Set when the animation has been canceled
83 private boolean mCanceled = false;
84
85 // Whether or not the input consumer is enabled. The input consumer must be both registered and
86 // enabled for it to start intercepting touch events.
87 private boolean mInputConsumerEnabled;
88
Winson Chunga89ffed2018-01-25 17:46:11 +000089 private Rect mTmpRect = new Rect();
90
Winson Chunge2d72172018-01-25 17:46:20 +000091 public interface RecentsAnimationCallbacks {
92 void onAnimationFinished(boolean moveHomeToTop);
93 }
94
95 private final IRecentsAnimationController mController =
96 new IRecentsAnimationController.Stub() {
97
98 @Override
99 public TaskSnapshot screenshotTask(int taskId) {
100 if (DEBUG) Log.d(TAG, "screenshotTask(" + taskId + "): mCanceled=" + mCanceled);
101 long token = Binder.clearCallingIdentity();
102 try {
103 synchronized (mService.getWindowManagerLock()) {
104 if (mCanceled) {
105 return null;
106 }
107 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
108 final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
109 final Task task = adapter.mTask;
110 if (task.mTaskId == taskId) {
Winson Chung23aa7b12018-02-01 11:41:43 -0800111 final TaskSnapshotController snapshotController =
112 mService.mTaskSnapshotController;
113 final ArraySet<Task> tasks = Sets.newArraySet(task);
114 snapshotController.snapshotTasks(tasks);
115 snapshotController.addSkipClosingAppSnapshotTasks(tasks);
116 return snapshotController.getSnapshot(taskId, 0 /* userId */,
117 false /* restoreFromDisk */, false /* reducedResolution */);
Winson Chunge2d72172018-01-25 17:46:20 +0000118 }
119 }
120 return null;
121 }
122 } finally {
123 Binder.restoreCallingIdentity(token);
124 }
125 }
126
127 @Override
128 public void finish(boolean moveHomeToTop) {
129 if (DEBUG) Log.d(TAG, "finish(" + moveHomeToTop + "): mCanceled=" + mCanceled);
130 long token = Binder.clearCallingIdentity();
131 try {
132 synchronized (mService.getWindowManagerLock()) {
133 if (mCanceled) {
134 return;
135 }
136 }
137
138 // Note, the callback will handle its own synchronization, do not lock on WM lock
139 // prior to calling the callback
140 mCallbacks.onAnimationFinished(moveHomeToTop);
141 } finally {
142 Binder.restoreCallingIdentity(token);
143 }
144 }
145
146 @Override
Jorim Jaggi50bf59c2018-03-09 17:29:48 +0100147 public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars)
148 throws RemoteException {
149 long token = Binder.clearCallingIdentity();
150 try {
151 synchronized (mService.getWindowManagerLock()) {
152 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
153 mPendingAnimations.get(i).mTask.setCanAffectSystemUiFlags(behindSystemBars);
154 }
155 mService.mWindowPlacerLocked.requestTraversal();
156 }
157 } finally {
158 Binder.restoreCallingIdentity(token);
159 }
160 }
161
162 @Override
Winson Chunge2d72172018-01-25 17:46:20 +0000163 public void setInputConsumerEnabled(boolean enabled) {
164 if (DEBUG) Log.d(TAG, "setInputConsumerEnabled(" + enabled + "): mCanceled="
165 + mCanceled);
166 long token = Binder.clearCallingIdentity();
167 try {
168 synchronized (mService.getWindowManagerLock()) {
169 if (mCanceled) {
170 return;
171 }
172
173 mInputConsumerEnabled = enabled;
174 mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
175 mService.scheduleAnimationLocked();
176 }
177 } finally {
178 Binder.restoreCallingIdentity(token);
179 }
180 }
181 };
182
183 /**
Winson Chunge2d72172018-01-25 17:46:20 +0000184 * @param remoteAnimationRunner The remote runner which should be notified when the animation is
185 * ready to start or has been canceled
186 * @param callbacks Callbacks to be made when the animation finishes
Winson Chunge2d72172018-01-25 17:46:20 +0000187 */
188 RecentsAnimationController(WindowManagerService service,
189 IRecentsAnimationRunner remoteAnimationRunner, RecentsAnimationCallbacks callbacks,
190 int displayId) {
191 mService = service;
192 mRunner = remoteAnimationRunner;
193 mCallbacks = callbacks;
Winson Chungddf62972018-02-12 11:10:04 -0800194 mDisplayId = displayId;
195 }
Winson Chunge2d72172018-01-25 17:46:20 +0000196
Winson Chungddf62972018-02-12 11:10:04 -0800197 /**
198 * Initializes the recents animation controller. This is a separate call from the constructor
199 * because it may call cancelAnimation() which needs to properly clean up the controller
200 * in the window manager.
201 */
Vadim Tryshev593e9562018-03-08 17:15:45 -0800202 public void initialize(SparseBooleanArray recentTaskIds) {
Winson Chunge2d72172018-01-25 17:46:20 +0000203 // Make leashes for each of the visible tasks and add it to the recents animation to be
204 // started
Winson Chungddf62972018-02-12 11:10:04 -0800205 final DisplayContent dc = mService.mRoot.getDisplayContent(mDisplayId);
206 final ArrayList<Task> visibleTasks = dc.getVisibleTasks();
Winson Chunge2d72172018-01-25 17:46:20 +0000207 final int taskCount = visibleTasks.size();
208 for (int i = 0; i < taskCount; i++) {
209 final Task task = visibleTasks.get(i);
210 final WindowConfiguration config = task.getWindowConfiguration();
211 if (config.tasksAreFloating()
212 || config.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
213 || config.getActivityType() == ACTIVITY_TYPE_HOME) {
214 continue;
215 }
Vadim Tryshev593e9562018-03-08 17:15:45 -0800216 addAnimation(task, !recentTaskIds.get(task.mTaskId));
Winson Chunge2d72172018-01-25 17:46:20 +0000217 }
218
Winson Chungddf62972018-02-12 11:10:04 -0800219 // Skip the animation if there is nothing to animate
220 if (mPendingAnimations.isEmpty()) {
221 cancelAnimation();
222 return;
223 }
224
Winson Chunge2d72172018-01-25 17:46:20 +0000225 // Adjust the wallpaper visibility for the showing home activity
226 final AppWindowToken recentsComponentAppToken =
227 dc.getHomeStack().getTopChild().getTopFullscreenAppToken();
228 if (recentsComponentAppToken != null) {
229 if (DEBUG) Log.d(TAG, "setHomeApp(" + recentsComponentAppToken.getName() + ")");
230 mHomeAppToken = recentsComponentAppToken;
Winson Chunge2d72172018-01-25 17:46:20 +0000231 if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) {
232 dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
233 dc.setLayoutNeeded();
234 }
235 }
236
Winson Chung584d6522018-02-07 23:57:38 +0000237 // Save the minimized home height
238 dc.getDockedDividerController().getHomeStackBoundsInDockedMode(mMinimizedHomeBounds);
239
Winson Chunge2d72172018-01-25 17:46:20 +0000240 mService.mWindowPlacerLocked.performSurfacePlacement();
241 }
242
Vadim Tryshev593e9562018-03-08 17:15:45 -0800243 private void addAnimation(Task task, boolean isRecentTaskInvisible) {
Winson Chunge2d72172018-01-25 17:46:20 +0000244 if (DEBUG) Log.d(TAG, "addAnimation(" + task.getName() + ")");
245 final SurfaceAnimator anim = new SurfaceAnimator(task, null /* animationFinishedCallback */,
Chavi Weingartenb736e322018-02-23 00:27:54 +0000246 mService);
Vadim Tryshev593e9562018-03-08 17:15:45 -0800247 final TaskAnimationAdapter taskAdapter = new TaskAnimationAdapter(task,
248 isRecentTaskInvisible);
Winson Chunge2d72172018-01-25 17:46:20 +0000249 anim.startAnimation(task.getPendingTransaction(), taskAdapter, false /* hidden */);
250 task.commitPendingTransaction();
251 mPendingAnimations.add(taskAdapter);
252 }
253
254 void startAnimation() {
Winson Chungddf62972018-02-12 11:10:04 -0800255 if (DEBUG) Log.d(TAG, "startAnimation(): mPendingStart=" + mPendingStart
256 + " mCanceled=" + mCanceled);
257 if (!mPendingStart || mCanceled) {
258 // Skip starting if we've already started or canceled the animation
Winson Chunge2d72172018-01-25 17:46:20 +0000259 return;
260 }
261 try {
Winson Chung2dc37362018-03-12 17:57:06 -0700262 final ArrayList<RemoteAnimationTarget> appAnimations = new ArrayList<>();
Winson Chunge2d72172018-01-25 17:46:20 +0000263 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
Winson Chung2dc37362018-03-12 17:57:06 -0700264 final RemoteAnimationTarget target =
265 mPendingAnimations.get(i).createRemoteAnimationApp();
266 if (target != null) {
267 appAnimations.add(target);
268 }
Winson Chunge2d72172018-01-25 17:46:20 +0000269 }
Winson Chung2dc37362018-03-12 17:57:06 -0700270 final RemoteAnimationTarget[] appTargets = appAnimations.toArray(
271 new RemoteAnimationTarget[appAnimations.size()]);
Winson Chunge2d72172018-01-25 17:46:20 +0000272 mPendingStart = false;
Winson Chung584d6522018-02-07 23:57:38 +0000273
274 final Rect minimizedHomeBounds =
275 mHomeAppToken != null && mHomeAppToken.inSplitScreenSecondaryWindowingMode()
276 ? mMinimizedHomeBounds : null;
277 final Rect contentInsets =
278 mHomeAppToken != null && mHomeAppToken.findMainWindow() != null
279 ? mHomeAppToken.findMainWindow().mContentInsets : null;
Winson Chung2dc37362018-03-12 17:57:06 -0700280 mRunner.onAnimationStart_New(mController, appTargets, contentInsets,
Winson Chung584d6522018-02-07 23:57:38 +0000281 minimizedHomeBounds);
Winson Chunge2d72172018-01-25 17:46:20 +0000282 } catch (RemoteException e) {
283 Slog.e(TAG, "Failed to start recents animation", e);
284 }
Jorim Jaggi54cff642018-03-15 15:51:32 +0100285 final SparseIntArray reasons = new SparseIntArray();
286 reasons.put(WINDOWING_MODE_FULLSCREEN, APP_TRANSITION_RECENTS_ANIM);
287 mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING,
288 reasons).sendToTarget();
Winson Chunge2d72172018-01-25 17:46:20 +0000289 }
290
291 void cancelAnimation() {
292 if (DEBUG) Log.d(TAG, "cancelAnimation()");
Winson Chung65fc89a2018-02-28 08:32:12 -0800293 synchronized (mService.getWindowManagerLock()) {
294 if (mCanceled) {
295 // We've already canceled the animation
296 return;
297 }
298 mCanceled = true;
299 try {
300 mRunner.onAnimationCanceled();
301 } catch (RemoteException e) {
302 Slog.e(TAG, "Failed to cancel recents animation", e);
303 }
Winson Chunge2d72172018-01-25 17:46:20 +0000304 }
Winson Chunge2d72172018-01-25 17:46:20 +0000305 // Clean up and return to the previous app
Winson Chung65fc89a2018-02-28 08:32:12 -0800306 // Don't hold the WM lock here as it calls back to AM/RecentsAnimation
Winson Chunge2d72172018-01-25 17:46:20 +0000307 mCallbacks.onAnimationFinished(false /* moveHomeToTop */);
308 }
309
chaviw87ca63a2018-03-26 14:06:17 -0700310 void cleanupAnimation(boolean moveHomeToTop) {
Winson Chunge2d72172018-01-25 17:46:20 +0000311 if (DEBUG) Log.d(TAG, "cleanupAnimation(): mPendingAnimations="
312 + mPendingAnimations.size());
313 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
314 final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
Jorim Jaggi50bf59c2018-03-09 17:29:48 +0100315 adapter.mTask.setCanAffectSystemUiFlags(true);
chaviw87ca63a2018-03-26 14:06:17 -0700316 if (moveHomeToTop) {
317 adapter.mTask.dontAnimateDimExit();
318 }
Winson Chunge2d72172018-01-25 17:46:20 +0000319 adapter.mCapturedFinishCallback.onAnimationFinished(adapter);
320 }
321 mPendingAnimations.clear();
322
323 mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
Winson Chunga89ffed2018-01-25 17:46:11 +0000324 mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION);
Winson Chunge2d72172018-01-25 17:46:20 +0000325 }
326
327 void checkAnimationReady(WallpaperController wallpaperController) {
328 if (mPendingStart) {
329 final boolean wallpaperReady = !isHomeAppOverWallpaper()
330 || (wallpaperController.getWallpaperTarget() != null
331 && wallpaperController.wallpaperTransitionReady());
332 if (wallpaperReady) {
333 mService.getRecentsAnimationController().startAnimation();
334 }
335 }
336 }
337
338 boolean isWallpaperVisible(WindowState w) {
339 return w != null && w.mAppToken != null && mHomeAppToken == w.mAppToken
340 && isHomeAppOverWallpaper();
341 }
342
Winson Chunga89ffed2018-01-25 17:46:11 +0000343 boolean hasInputConsumerForApp(AppWindowToken appToken) {
344 return mInputConsumerEnabled && isAnimatingApp(appToken);
345 }
346
347 boolean updateInputConsumerForApp(InputConsumerImpl recentsAnimationInputConsumer,
348 boolean hasFocus) {
349 // Update the input consumer touchable region to match the home app main window
350 final WindowState homeAppMainWindow = mHomeAppToken != null
351 ? mHomeAppToken.findMainWindow()
352 : null;
353 if (homeAppMainWindow != null) {
354 homeAppMainWindow.getBounds(mTmpRect);
355 recentsAnimationInputConsumer.mWindowHandle.hasFocus = hasFocus;
356 recentsAnimationInputConsumer.mWindowHandle.touchableRegion.set(mTmpRect);
357 return true;
358 }
359 return false;
360 }
361
362 private boolean isHomeAppOverWallpaper() {
Winson Chunge2d72172018-01-25 17:46:20 +0000363 if (mHomeAppToken == null) {
364 return false;
365 }
366 return mHomeAppToken.windowsCanBeWallpaperTarget();
367 }
368
Winson Chunga89ffed2018-01-25 17:46:11 +0000369 private boolean isAnimatingApp(AppWindowToken appToken) {
Winson Chunge2d72172018-01-25 17:46:20 +0000370 for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
371 final Task task = mPendingAnimations.get(i).mTask;
372 for (int j = task.getChildCount() - 1; j >= 0; j--) {
373 final AppWindowToken app = task.getChildAt(j);
374 if (app == appToken) {
375 return true;
376 }
377 }
378 }
379 return false;
380 }
381
Winson Chunge2d72172018-01-25 17:46:20 +0000382 private class TaskAnimationAdapter implements AnimationAdapter {
383
Vadim Tryshev593e9562018-03-08 17:15:45 -0800384 private final Task mTask;
Winson Chunge2d72172018-01-25 17:46:20 +0000385 private SurfaceControl mCapturedLeash;
386 private OnAnimationFinishedCallback mCapturedFinishCallback;
Vadim Tryshev593e9562018-03-08 17:15:45 -0800387 private final boolean mIsRecentTaskInvisible;
Jorim Jaggif75d1612018-02-27 15:05:21 +0100388 private RemoteAnimationTarget mTarget;
Winson Chunge2d72172018-01-25 17:46:20 +0000389
Vadim Tryshev593e9562018-03-08 17:15:45 -0800390 TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
Winson Chunge2d72172018-01-25 17:46:20 +0000391 mTask = task;
Vadim Tryshev593e9562018-03-08 17:15:45 -0800392 mIsRecentTaskInvisible = isRecentTaskInvisible;
Winson Chunge2d72172018-01-25 17:46:20 +0000393 }
394
395 RemoteAnimationTarget createRemoteAnimationApp() {
Winson Chung584d6522018-02-07 23:57:38 +0000396 final Point position = new Point();
397 final Rect bounds = new Rect();
398 final WindowContainer container = mTask.getParent();
399 container.getRelativePosition(position);
400 container.getBounds(bounds);
401 final WindowState mainWindow = mTask.getTopVisibleAppMainWindow();
Winson Chung2dc37362018-03-12 17:57:06 -0700402 if (mainWindow == null) {
403 return null;
404 }
Jorim Jaggif75d1612018-02-27 15:05:21 +0100405 mTarget = new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash,
Winson Chung584d6522018-02-07 23:57:38 +0000406 !mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
407 mainWindow.mContentInsets, mTask.getPrefixOrderIndex(), position, bounds,
Vadim Tryshev593e9562018-03-08 17:15:45 -0800408 mTask.getWindowConfiguration(), mIsRecentTaskInvisible);
Jorim Jaggif75d1612018-02-27 15:05:21 +0100409 return mTarget;
Winson Chunge2d72172018-01-25 17:46:20 +0000410 }
411
412 @Override
413 public boolean getDetachWallpaper() {
414 return false;
415 }
416
417 @Override
Jorim Jaggi82c17862018-02-21 17:50:18 +0100418 public boolean getShowWallpaper() {
419 return false;
420 }
421
422 @Override
Winson Chunge2d72172018-01-25 17:46:20 +0000423 public int getBackgroundColor() {
424 return 0;
425 }
426
427 @Override
428 public void startAnimation(SurfaceControl animationLeash, Transaction t,
429 OnAnimationFinishedCallback finishCallback) {
430 mCapturedLeash = animationLeash;
431 mCapturedFinishCallback = finishCallback;
432 }
433
434 @Override
435 public void onAnimationCancelled(SurfaceControl animationLeash) {
436 cancelAnimation();
437 }
438
439 @Override
440 public long getDurationHint() {
441 return 0;
442 }
443
444 @Override
445 public long getStatusBarTransitionsStartTime() {
446 return SystemClock.uptimeMillis();
447 }
Jorim Jaggif75d1612018-02-27 15:05:21 +0100448
449 @Override
450 public void dump(PrintWriter pw, String prefix) {
451 pw.print(prefix); pw.println("task=" + mTask);
452 if (mTarget != null) {
453 pw.print(prefix); pw.println("Target:");
454 mTarget.dump(pw, prefix + " ");
455 } else {
456 pw.print(prefix); pw.println("Target: null");
457 }
458 }
459
460 @Override
461 public void writeToProto(ProtoOutputStream proto) {
462 final long token = proto.start(REMOTE);
463 if (mTarget != null) {
464 mTarget.writeToProto(proto, TARGET);
465 }
466 proto.end(token);
467 }
Winson Chunge2d72172018-01-25 17:46:20 +0000468 }
469
470 public void dump(PrintWriter pw, String prefix) {
471 final String innerPrefix = prefix + " ";
472 pw.print(prefix); pw.println(RecentsAnimationController.class.getSimpleName() + ":");
473 pw.print(innerPrefix); pw.println("mPendingStart=" + mPendingStart);
474 pw.print(innerPrefix); pw.println("mHomeAppToken=" + mHomeAppToken);
475 }
476}