blob: d4de521e35667e146093bea45b4c273f52f8e2d8 [file] [log] [blame]
Filip Gruszczynski77d94482015-12-11 13:59:52 -08001package com.android.server.am;
2
Jorim Jaggi3878ca32017-02-02 17:13:05 -08003import static android.app.ActivityManager.START_SUCCESS;
4import static android.app.ActivityManager.START_TASK_TO_FRONT;
Winson Chung83471632016-12-13 11:02:12 -08005import static android.app.ActivityManager.StackId.ASSISTANT_STACK_ID;
Filip Gruszczynski77d94482015-12-11 13:59:52 -08006import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
7import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
8import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
Jorim Jaggi3878ca32017-02-02 17:13:05 -08009import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -080010import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080011import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT;
12import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION;
Todd Kennedy50d946c12017-03-17 13:55:38 -070013import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CALLING_PACKAGE_NAME;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080014import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DELAY_MS;
15import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS;
Todd Kennedy50d946c12017-03-17 13:55:38 -070016import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_IS_EPHEMERAL;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080017import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_STARTING_WINDOW_DELAY_MS;
18import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS;
Jorim Jaggicdfc04e2017-04-28 19:06:24 +020019import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_CLASS_NAME;
Todd Kennedy50d946c12017-03-17 13:55:38 -070020import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.FIELD_INSTANT_APP_LAUNCH_TOKEN;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080021import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_COLD_LAUNCH;
22import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_HOT_LAUNCH;
23import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_WARM_LAUNCH;
Jorim Jaggif9704102016-05-05 19:14:22 -070024import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
25import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
Filip Gruszczynski0e381e22016-01-14 16:31:33 -080026import static com.android.server.am.ActivityStack.STACK_INVISIBLE;
Filip Gruszczynski77d94482015-12-11 13:59:52 -080027
28import android.app.ActivityManager.StackId;
29import android.content.Context;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080030import android.metrics.LogMaker;
Filip Gruszczynski77d94482015-12-11 13:59:52 -080031import android.os.SystemClock;
Jorim Jaggif9704102016-05-05 19:14:22 -070032import android.util.Slog;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080033import android.util.SparseArray;
34import android.util.SparseIntArray;
Filip Gruszczynski77d94482015-12-11 13:59:52 -080035
36import com.android.internal.logging.MetricsLogger;
37
Jorim Jaggi1e630c02016-05-16 12:13:13 -070038import java.util.ArrayList;
39
Filip Gruszczynski77d94482015-12-11 13:59:52 -080040/**
41 * Handles logging into Tron.
42 */
43class ActivityMetricsLogger {
Jorim Jaggif9704102016-05-05 19:14:22 -070044
45 private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityMetricsLogger" : TAG_AM;
46
Filip Gruszczynski77d94482015-12-11 13:59:52 -080047 // Window modes we are interested in logging. If we ever introduce a new type, we need to add
48 // a value here and increase the {@link #TRON_WINDOW_STATE_VARZ_STRINGS} array.
49 private static final int WINDOW_STATE_STANDARD = 0;
50 private static final int WINDOW_STATE_SIDE_BY_SIDE = 1;
51 private static final int WINDOW_STATE_FREEFORM = 2;
Winson Chung83471632016-12-13 11:02:12 -080052 private static final int WINDOW_STATE_ASSISTANT = 3;
Filip Gruszczynski77d94482015-12-11 13:59:52 -080053 private static final int WINDOW_STATE_INVALID = -1;
54
Jorim Jaggi275561a2016-02-23 10:11:02 -050055 private static final long INVALID_START_TIME = -1;
56
Filip Gruszczynski77d94482015-12-11 13:59:52 -080057 // Preallocated strings we are sending to tron, so we don't have to allocate a new one every
58 // time we log.
59 private static final String[] TRON_WINDOW_STATE_VARZ_STRINGS = {
Winson Chung83471632016-12-13 11:02:12 -080060 "window_time_0", "window_time_1", "window_time_2", "window_time_3"};
Filip Gruszczynski77d94482015-12-11 13:59:52 -080061
62 private int mWindowState = WINDOW_STATE_STANDARD;
63 private long mLastLogTimeSecs;
64 private final ActivityStackSupervisor mSupervisor;
65 private final Context mContext;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080066 private final MetricsLogger mMetricsLogger = new MetricsLogger();
Filip Gruszczynski77d94482015-12-11 13:59:52 -080067
Jorim Jaggi275561a2016-02-23 10:11:02 -050068 private long mCurrentTransitionStartTime = INVALID_START_TIME;
Jorim Jaggi3878ca32017-02-02 17:13:05 -080069
70 private int mCurrentTransitionDeviceUptime;
71 private int mCurrentTransitionDelayMs;
Jorim Jaggi275561a2016-02-23 10:11:02 -050072 private boolean mLoggedTransitionStarting;
73
Jorim Jaggi3878ca32017-02-02 17:13:05 -080074 private final SparseArray<StackTransitionInfo> mStackTransitionInfo = new SparseArray<>();
75
76 private final class StackTransitionInfo {
77 private ActivityRecord launchedActivity;
78 private int startResult;
79 private boolean currentTransitionProcessRunning;
80 private int windowsDrawnDelayMs;
81 private int startingWindowDelayMs;
82 private int reason = APP_TRANSITION_TIMEOUT;
83 private boolean loggedWindowsDrawn;
84 private boolean loggedStartingWindowDrawn;
85 }
86
Filip Gruszczynski77d94482015-12-11 13:59:52 -080087 ActivityMetricsLogger(ActivityStackSupervisor supervisor, Context context) {
88 mLastLogTimeSecs = SystemClock.elapsedRealtime() / 1000;
89 mSupervisor = supervisor;
90 mContext = context;
91 }
92
93 void logWindowState() {
94 final long now = SystemClock.elapsedRealtime() / 1000;
95 if (mWindowState != WINDOW_STATE_INVALID) {
96 // We log even if the window state hasn't changed, because the user might remain in
97 // home/fullscreen move forever and we would like to track this kind of behavior
98 // too.
99 MetricsLogger.count(mContext, TRON_WINDOW_STATE_VARZ_STRINGS[mWindowState],
100 (int) (now - mLastLogTimeSecs));
101 }
102 mLastLogTimeSecs = now;
103
Filip Gruszczynski77d94482015-12-11 13:59:52 -0800104 ActivityStack stack = mSupervisor.getStack(DOCKED_STACK_ID);
Wale Ogunwalecd501ec2017-04-07 08:53:41 -0700105 if (stack != null && stack.shouldBeVisible(null) != STACK_INVISIBLE) {
Filip Gruszczynski77d94482015-12-11 13:59:52 -0800106 mWindowState = WINDOW_STATE_SIDE_BY_SIDE;
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -0800107 return;
Filip Gruszczynski77d94482015-12-11 13:59:52 -0800108 }
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -0800109 mWindowState = WINDOW_STATE_INVALID;
110 stack = mSupervisor.getFocusedStack();
111 if (stack.mStackId == PINNED_STACK_ID) {
112 stack = mSupervisor.findStackBehind(stack);
113 }
Matthew Ngae1ff4f2016-11-10 15:49:14 -0800114 if (StackId.isHomeOrRecentsStack(stack.mStackId)
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -0800115 || stack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) {
116 mWindowState = WINDOW_STATE_STANDARD;
117 } else if (stack.mStackId == DOCKED_STACK_ID) {
Jorim Jaggif9704102016-05-05 19:14:22 -0700118 Slog.wtf(TAG, "Docked stack shouldn't be the focused stack, because it reported not"
119 + " being visible.");
120 mWindowState = WINDOW_STATE_INVALID;
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -0800121 } else if (stack.mStackId == FREEFORM_WORKSPACE_STACK_ID) {
122 mWindowState = WINDOW_STATE_FREEFORM;
Winson Chung83471632016-12-13 11:02:12 -0800123 } else if (stack.mStackId == ASSISTANT_STACK_ID) {
124 mWindowState = WINDOW_STATE_ASSISTANT;
Filip Gruszczynskicaae14e2015-12-16 14:40:04 -0800125 } else if (StackId.isStaticStack(stack.mStackId)) {
126 throw new IllegalStateException("Unknown stack=" + stack);
Filip Gruszczynski77d94482015-12-11 13:59:52 -0800127 }
128 }
Jorim Jaggi275561a2016-02-23 10:11:02 -0500129
130 /**
131 * Notifies the tracker at the earliest possible point when we are starting to launch an
132 * activity.
133 */
134 void notifyActivityLaunching() {
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800135 if (!isAnyTransitionActive()) {
Alison Cichowlasb7f67ab2017-04-25 18:04:40 -0400136 mCurrentTransitionStartTime = SystemClock.uptimeMillis();
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800137 }
Jorim Jaggi275561a2016-02-23 10:11:02 -0500138 }
139
140 /**
Jorim Jaggi1e630c02016-05-16 12:13:13 -0700141 * Notifies the tracker that the activity is actually launching.
142 *
143 * @param resultCode one of the ActivityManager.START_* flags, indicating the result of the
144 * launch
145 * @param launchedActivity the activity that is being launched
146 */
147 void notifyActivityLaunched(int resultCode, ActivityRecord launchedActivity) {
148 final ProcessRecord processRecord = launchedActivity != null
149 ? mSupervisor.mService.mProcessNames.get(launchedActivity.processName,
150 launchedActivity.appInfo.uid)
151 : null;
152 final boolean processRunning = processRecord != null;
Jorim Jaggi1e630c02016-05-16 12:13:13 -0700153
154 // We consider this a "process switch" if the process of the activity that gets launched
155 // didn't have an activity that was in started state. In this case, we assume that lot
156 // of caches might be purged so the time until it produces the first frame is very
157 // interesting.
158 final boolean processSwitch = processRecord == null
159 || !hasStartedActivity(processRecord, launchedActivity);
160
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800161 notifyActivityLaunched(resultCode, launchedActivity, processRunning, processSwitch);
Jorim Jaggi1e630c02016-05-16 12:13:13 -0700162 }
163
164 private boolean hasStartedActivity(ProcessRecord record, ActivityRecord launchedActivity) {
165 final ArrayList<ActivityRecord> activities = record.activities;
166 for (int i = activities.size() - 1; i >= 0; i--) {
167 final ActivityRecord activity = activities.get(i);
168 if (launchedActivity == activity) {
169 continue;
170 }
171 if (!activity.stopped) {
172 return true;
173 }
174 }
175 return false;
176 }
177
178 /**
Jorim Jaggi275561a2016-02-23 10:11:02 -0500179 * Notifies the tracker the the activity is actually launching.
180 *
181 * @param resultCode one of the ActivityManager.START_* flags, indicating the result of the
182 * launch
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800183 * @param launchedActivity the activity being launched
Jorim Jaggi275561a2016-02-23 10:11:02 -0500184 * @param processRunning whether the process that will contains the activity is already running
Jorim Jaggibe67c902016-04-12 00:53:16 -0700185 * @param processSwitch whether the process that will contain the activity didn't have any
186 * activity that was stopped, i.e. the started activity is "switching"
187 * processes
Jorim Jaggi275561a2016-02-23 10:11:02 -0500188 */
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800189 private void notifyActivityLaunched(int resultCode, ActivityRecord launchedActivity,
Jorim Jaggibe67c902016-04-12 00:53:16 -0700190 boolean processRunning, boolean processSwitch) {
Jorim Jaggi275561a2016-02-23 10:11:02 -0500191
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800192 // If we are already in an existing transition, only update the activity name, but not the
193 // other attributes.
194 final int stackId = launchedActivity != null && launchedActivity.getStack() != null
195 ? launchedActivity.getStack().mStackId
196 : INVALID_STACK_ID;
Jorim Jaggicdfc04e2017-04-28 19:06:24 +0200197
198 if (mCurrentTransitionStartTime == INVALID_START_TIME) {
199 return;
200 }
201
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800202 final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
203 if (launchedActivity != null && info != null) {
204 info.launchedActivity = launchedActivity;
Jorim Jaggi275561a2016-02-23 10:11:02 -0500205 return;
206 }
207
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800208 final boolean otherStacksLaunching = mStackTransitionInfo.size() > 0 && info == null;
209 if ((resultCode < 0 || launchedActivity == null || !processSwitch
210 || stackId == INVALID_STACK_ID) && !otherStacksLaunching) {
Alison Cichowlas803054d2016-12-13 14:38:01 -0500211
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800212 // Failed to launch or it was not a process switch, so we don't care about the timing.
213 reset(true /* abort */);
214 return;
215 } else if (otherStacksLaunching) {
216 // Don't log this stack but continue with the other stacks.
217 return;
218 }
219
220 final StackTransitionInfo newInfo = new StackTransitionInfo();
221 newInfo.launchedActivity = launchedActivity;
222 newInfo.currentTransitionProcessRunning = processRunning;
223 newInfo.startResult = resultCode;
224 mStackTransitionInfo.append(stackId, newInfo);
225 mCurrentTransitionDeviceUptime = (int) (SystemClock.uptimeMillis() / 1000);
Jorim Jaggi275561a2016-02-23 10:11:02 -0500226 }
227
228 /**
229 * Notifies the tracker that all windows of the app have been drawn.
230 */
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800231 void notifyWindowsDrawn(int stackId) {
232 final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
233 if (info == null || info.loggedWindowsDrawn) {
Jorim Jaggi275561a2016-02-23 10:11:02 -0500234 return;
235 }
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800236 info.windowsDrawnDelayMs = calculateCurrentDelay();
237 info.loggedWindowsDrawn = true;
238 if (allStacksWindowsDrawn() && mLoggedTransitionStarting) {
239 reset(false /* abort */);
Jorim Jaggi275561a2016-02-23 10:11:02 -0500240 }
241 }
242
243 /**
244 * Notifies the tracker that the starting window was drawn.
245 */
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800246 void notifyStartingWindowDrawn(int stackId) {
247 final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
248 if (info == null || info.loggedStartingWindowDrawn) {
Jorim Jaggi275561a2016-02-23 10:11:02 -0500249 return;
250 }
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800251 info.loggedStartingWindowDrawn = true;
252 info.startingWindowDelayMs = calculateCurrentDelay();
Jorim Jaggi275561a2016-02-23 10:11:02 -0500253 }
254
255 /**
256 * Notifies the tracker that the app transition is starting.
257 *
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800258 * @param stackIdReasons A map from stack id to a reason integer, which must be on of
259 * ActivityManagerInternal.APP_TRANSITION_* reasons.
Jorim Jaggi275561a2016-02-23 10:11:02 -0500260 */
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800261 void notifyTransitionStarting(SparseIntArray stackIdReasons) {
Jorim Jaggid8a57772017-04-14 16:50:42 -0700262 if (!isAnyTransitionActive() || mLoggedTransitionStarting) {
Jorim Jaggi275561a2016-02-23 10:11:02 -0500263 return;
264 }
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800265 mCurrentTransitionDelayMs = calculateCurrentDelay();
Jorim Jaggi275561a2016-02-23 10:11:02 -0500266 mLoggedTransitionStarting = true;
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800267 for (int index = stackIdReasons.size() - 1; index >= 0; index--) {
268 final int stackId = stackIdReasons.keyAt(index);
269 final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
270 if (info == null) {
271 continue;
272 }
273 info.reason = stackIdReasons.valueAt(index);
274 }
275 if (allStacksWindowsDrawn()) {
276 reset(false /* abort */);
Jorim Jaggi275561a2016-02-23 10:11:02 -0500277 }
278 }
279
Jorim Jaggicdfc04e2017-04-28 19:06:24 +0200280 /**
281 * Notifies the tracker that the visibility of an app is changing.
282 *
283 * @param activityRecord the app that is changing its visibility
284 * @param visible whether it's going to be visible or not
285 */
286 void notifyVisibilityChanged(ActivityRecord activityRecord, boolean visible) {
287 final StackTransitionInfo info = mStackTransitionInfo.get(activityRecord.getStackId());
288
289 // If we have an active transition that's waiting on a certain activity that will be
290 // invisible now, we'll never get onWindowsDrawn, so abort the transition if necessary.
291 if (info != null && !visible && info.launchedActivity == activityRecord) {
292 mStackTransitionInfo.remove(activityRecord.getStackId());
293 if (mStackTransitionInfo.size() == 0) {
294 reset(true /* abort */);
295 }
296 }
297 }
298
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800299 private boolean allStacksWindowsDrawn() {
300 for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) {
301 if (!mStackTransitionInfo.valueAt(index).loggedWindowsDrawn) {
302 return false;
303 }
304 }
305 return true;
Jorim Jaggi275561a2016-02-23 10:11:02 -0500306 }
307
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800308 private boolean isAnyTransitionActive() {
309 return mCurrentTransitionStartTime != INVALID_START_TIME
310 && mStackTransitionInfo.size() > 0;
311 }
312
313 private void reset(boolean abort) {
314 if (!abort && isAnyTransitionActive()) {
315 logAppTransitionMultiEvents();
316 }
Jorim Jaggi275561a2016-02-23 10:11:02 -0500317 mCurrentTransitionStartTime = INVALID_START_TIME;
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800318 mCurrentTransitionDelayMs = -1;
Jorim Jaggi275561a2016-02-23 10:11:02 -0500319 mLoggedTransitionStarting = false;
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800320 mStackTransitionInfo.clear();
Jorim Jaggi275561a2016-02-23 10:11:02 -0500321 }
322
323 private int calculateCurrentDelay() {
324
325 // Shouldn't take more than 25 days to launch an app, so int is fine here.
Alison Cichowlasb7f67ab2017-04-25 18:04:40 -0400326 return (int) (SystemClock.uptimeMillis() - mCurrentTransitionStartTime);
Jorim Jaggi275561a2016-02-23 10:11:02 -0500327 }
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800328
329 private void logAppTransitionMultiEvents() {
330 for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) {
331 final StackTransitionInfo info = mStackTransitionInfo.valueAt(index);
332 final int type = getTransitionType(info);
333 if (type == -1) {
334 return;
335 }
336 final LogMaker builder = new LogMaker(APP_TRANSITION);
337 builder.setPackageName(info.launchedActivity.packageName);
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800338 builder.setType(type);
Jason Monk8c09ac72017-03-16 11:53:40 -0400339 builder.addTaggedData(FIELD_CLASS_NAME, info.launchedActivity.info.name);
Todd Kennedy56279cb2017-04-17 14:53:49 -0700340 final boolean isInstantApp = info.launchedActivity.info.applicationInfo.isInstantApp();
341 if (isInstantApp && info.launchedActivity.launchedFromPackage != null) {
Todd Kennedy50d946c12017-03-17 13:55:38 -0700342 builder.addTaggedData(APP_TRANSITION_CALLING_PACKAGE_NAME,
343 info.launchedActivity.launchedFromPackage);
344 }
345 if (info.launchedActivity.info.launchToken != null) {
346 builder.addTaggedData(FIELD_INSTANT_APP_LAUNCH_TOKEN,
347 info.launchedActivity.info.launchToken);
Todd Kennedyb3b431302017-03-20 16:05:48 -0700348 info.launchedActivity.info.launchToken = null;
Todd Kennedy50d946c12017-03-17 13:55:38 -0700349 }
Todd Kennedy56279cb2017-04-17 14:53:49 -0700350 builder.addTaggedData(APP_TRANSITION_IS_EPHEMERAL, isInstantApp ? 1 : 0);
Jorim Jaggi3878ca32017-02-02 17:13:05 -0800351 builder.addTaggedData(APP_TRANSITION_DEVICE_UPTIME_SECONDS,
352 mCurrentTransitionDeviceUptime);
353 builder.addTaggedData(APP_TRANSITION_DELAY_MS, mCurrentTransitionDelayMs);
354 builder.setSubtype(info.reason);
355 if (info.startingWindowDelayMs != -1) {
356 builder.addTaggedData(APP_TRANSITION_STARTING_WINDOW_DELAY_MS,
357 info.startingWindowDelayMs);
358 }
359 builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs);
360 mMetricsLogger.write(builder);
361 }
362 }
363
364 private int getTransitionType(StackTransitionInfo info) {
365 if (info.currentTransitionProcessRunning) {
366 if (info.startResult == START_SUCCESS) {
367 return TYPE_TRANSITION_WARM_LAUNCH;
368 } else if (info.startResult == START_TASK_TO_FRONT) {
369 return TYPE_TRANSITION_HOT_LAUNCH;
370 }
371 } else if (info.startResult == START_SUCCESS) {
372 return TYPE_TRANSITION_COLD_LAUNCH;
373 }
374 return -1;
375 }
Filip Gruszczynski77d94482015-12-11 13:59:52 -0800376}