blob: d79211ccf5b5670d597202740c2ac7776aa9557f [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 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.am;
18
Craig Mautnerde4ef022013-04-07 19:01:33 -070019import static com.android.server.am.ActivityManagerService.TAG;
Craig Mautner0eea92c2013-05-16 13:35:39 -070020import static com.android.server.am.ActivityStackSupervisor.DEBUG_ADD_REMOVE;
Craig Mautnerde4ef022013-04-07 19:01:33 -070021
Craig Mautnerb0f7dc72013-04-01 16:34:45 -070022import android.app.Activity;
Craig Mautner9db9a0b2013-04-29 17:05:56 -070023import android.app.ActivityManager;
Craig Mautnerb0f7dc72013-04-01 16:34:45 -070024import android.app.ActivityOptions;
Craig Mautner9db9a0b2013-04-29 17:05:56 -070025import android.app.IThumbnailRetriever;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.content.ComponentName;
27import android.content.Intent;
28import android.content.pm.ActivityInfo;
Craig Mautner9db9a0b2013-04-29 17:05:56 -070029import android.graphics.Bitmap;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070030import android.os.UserHandle;
Dianne Hackborn7f96b792012-05-29 18:46:45 -070031import android.util.Slog;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032
33import java.io.PrintWriter;
Craig Mautner5d9c7be2013-02-15 14:02:56 -080034import java.util.ArrayList;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035
Dianne Hackbornbe4e6aa2013-06-07 13:25:29 -070036final class TaskRecord extends ThumbnailHolder {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037 final int taskId; // Unique identifier for this task.
38 final String affinity; // The affinity name for this task, or null.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039 Intent intent; // The original intent that started the task.
40 Intent affinityIntent; // Intent of affinity-moved activity that started this task.
41 ComponentName origActivity; // The non-alias activity component of the intent.
42 ComponentName realActivity; // The actual activity component that started the task.
43 int numActivities; // Current number of activities in this task.
44 long lastActiveTime; // Last time this task was active, including sleep.
45 boolean rootWasReset; // True if the intent at the root of the task had
46 // the FLAG_ACTIVITY_RESET_TASK_IF_NEEDED flag.
Dianne Hackborn36cd41f2011-05-25 21:00:46 -070047 boolean askedCompatMode;// Have asked the user about compat mode for this task.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048
Dianne Hackborn1d442e02009-04-20 18:14:05 -070049 String stringName; // caching of toString() result.
Dianne Hackborn9da2d402012-03-15 13:43:08 -070050 int userId; // user for which this task was created
Craig Mautner5d9c7be2013-02-15 14:02:56 -080051
52 int numFullscreen; // Number of fullscreen activities.
53
Craig Mautnerd2328952013-03-05 12:46:26 -080054 /** List of all activities in the task arranged in history order */
Craig Mautner5d9c7be2013-02-15 14:02:56 -080055 final ArrayList<ActivityRecord> mActivities = new ArrayList<ActivityRecord>();
56
Craig Mautnerd2328952013-03-05 12:46:26 -080057 /** Current stack */
58 ActivityStack stack;
59
Craig Mautner78733002013-06-10 13:54:49 -070060 private boolean mApplicationTask = true;
Craig Mautner1602ec22013-05-12 10:24:27 -070061
Craig Mautnerd2328952013-03-05 12:46:26 -080062 TaskRecord(int _taskId, ActivityInfo info, Intent _intent, ActivityStack _stack) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063 taskId = _taskId;
64 affinity = info.taskAffinity;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 setIntent(_intent, info);
Craig Mautnerd2328952013-03-05 12:46:26 -080066 stack = _stack;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 }
68
69 void touchActiveTime() {
70 lastActiveTime = android.os.SystemClock.elapsedRealtime();
71 }
Craig Mautner9db9a0b2013-04-29 17:05:56 -070072
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 long getInactiveDuration() {
74 return android.os.SystemClock.elapsedRealtime() - lastActiveTime;
75 }
Craig Mautner9db9a0b2013-04-29 17:05:56 -070076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077 void setIntent(Intent _intent, ActivityInfo info) {
Dianne Hackborn1d442e02009-04-20 18:14:05 -070078 stringName = null;
Dianne Hackbornf5b86712011-12-05 17:42:41 -080079
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080 if (info.targetActivity == null) {
Dianne Hackbornf5b86712011-12-05 17:42:41 -080081 if (_intent != null) {
82 // If this Intent has a selector, we want to clear it for the
83 // recent task since it is not relevant if the user later wants
84 // to re-launch the app.
Dianne Hackbornd367ca82012-05-07 15:49:39 -070085 if (_intent.getSelector() != null || _intent.getSourceBounds() != null) {
Dianne Hackbornf5b86712011-12-05 17:42:41 -080086 _intent = new Intent(_intent);
87 _intent.setSelector(null);
Dianne Hackbornd367ca82012-05-07 15:49:39 -070088 _intent.setSourceBounds(null);
Dianne Hackbornf5b86712011-12-05 17:42:41 -080089 }
90 }
Dianne Hackborn7f96b792012-05-29 18:46:45 -070091 if (ActivityManagerService.DEBUG_TASKS) Slog.v(ActivityManagerService.TAG,
92 "Setting Intent of " + this + " to " + _intent);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 intent = _intent;
94 realActivity = _intent != null ? _intent.getComponent() : null;
95 origActivity = null;
96 } else {
97 ComponentName targetComponent = new ComponentName(
98 info.packageName, info.targetActivity);
99 if (_intent != null) {
100 Intent targetIntent = new Intent(_intent);
101 targetIntent.setComponent(targetComponent);
Dianne Hackbornf5b86712011-12-05 17:42:41 -0800102 targetIntent.setSelector(null);
Dianne Hackbornd367ca82012-05-07 15:49:39 -0700103 targetIntent.setSourceBounds(null);
Dianne Hackborn7f96b792012-05-29 18:46:45 -0700104 if (ActivityManagerService.DEBUG_TASKS) Slog.v(ActivityManagerService.TAG,
105 "Setting Intent of " + this + " to target " + targetIntent);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800106 intent = targetIntent;
107 realActivity = targetComponent;
108 origActivity = _intent.getComponent();
109 } else {
110 intent = null;
111 realActivity = targetComponent;
112 origActivity = new ComponentName(info.packageName, info.name);
113 }
114 }
Amith Yamasani742a6712011-05-04 14:49:28 -0700115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 if (intent != null &&
117 (intent.getFlags()&Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0) {
118 // Once we are set to an Intent with this flag, we count this
119 // task as having a true root activity.
120 rootWasReset = true;
121 }
Amith Yamasani742a6712011-05-04 14:49:28 -0700122
123 if (info.applicationInfo != null) {
Dianne Hackbornf02b60a2012-08-16 10:48:27 -0700124 userId = UserHandle.getUserId(info.applicationInfo.uid);
Amith Yamasani742a6712011-05-04 14:49:28 -0700125 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 }
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800127
128 ActivityRecord getTopActivity() {
129 for (int i = mActivities.size() - 1; i >= 0; --i) {
130 final ActivityRecord r = mActivities.get(i);
131 if (r.finishing) {
132 continue;
133 }
134 return r;
135 }
136 return null;
137 }
138
Craig Mautnerde4ef022013-04-07 19:01:33 -0700139 /**
140 * Reorder the history stack so that the activity at the given index is
141 * brought to the front.
142 */
143 final void moveActivityToFrontLocked(ActivityRecord newTop) {
144 if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing and adding activity " + newTop
145 + " to stack at top", new RuntimeException("here").fillInStackTrace());
146
147 getTopActivity().frontOfTask = false;
148 mActivities.remove(newTop);
149 mActivities.add(newTop);
150 newTop.frontOfTask = true;
151 }
152
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800153 void addActivityAtBottom(ActivityRecord r) {
Craig Mautner77878772013-03-04 19:46:24 -0800154 addActivityAtIndex(0, r);
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800155 }
156
157 void addActivityToTop(ActivityRecord r) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700158 addActivityAtIndex(mActivities.size(), r);
159 }
160
161 void addActivityAtIndex(int index, ActivityRecord r) {
Craig Mautner6170f732013-04-02 13:05:23 -0700162 // Remove r first, and if it wasn't already in the list and it's fullscreen, count it.
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800163 if (!mActivities.remove(r) && r.fullscreen) {
164 // Was not previously in list.
165 numFullscreen++;
166 }
Craig Mautner78733002013-06-10 13:54:49 -0700167 // Only set this to be an application task if it has not already been set as home task.
168 if (mApplicationTask) {
169 mApplicationTask = r.isApplicationActivity();
170 }
Craig Mautner77878772013-03-04 19:46:24 -0800171 mActivities.add(index, r);
172 }
173
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800174 /** @return true if this was the last activity in the task */
175 boolean removeActivity(ActivityRecord r) {
176 if (mActivities.remove(r) && r.fullscreen) {
177 // Was previously in list.
178 numFullscreen--;
179 }
180 return mActivities.size() == 0;
181 }
182
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700183 /**
184 * Completely remove all activities associated with an existing
185 * task starting at a specified index.
186 */
187 final void performClearTaskAtIndexLocked(int activityNdx) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700188 int numActivities = mActivities.size();
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700189 for ( ; activityNdx < numActivities; ++activityNdx) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700190 final ActivityRecord r = mActivities.get(activityNdx);
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700191 if (r.finishing) {
192 continue;
193 }
194 if (stack.finishActivityLocked(r, Activity.RESULT_CANCELED, null, "clear", false)) {
195 --activityNdx;
196 --numActivities;
197 }
198 }
199 }
200
201 /**
202 * Completely remove all activities associated with an existing task.
203 */
204 final void performClearTaskLocked() {
205 performClearTaskAtIndexLocked(0);
206 }
207
208 /**
209 * Perform clear operation as requested by
210 * {@link Intent#FLAG_ACTIVITY_CLEAR_TOP}: search from the top of the
211 * stack to the given task, then look for
212 * an instance of that activity in the stack and, if found, finish all
213 * activities on top of it and return the instance.
214 *
215 * @param newR Description of the new activity being started.
216 * @return Returns the old activity that should be continued to be used,
217 * or null if none was found.
218 */
219 final ActivityRecord performClearTaskLocked(ActivityRecord newR, int launchFlags) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700220 int numActivities = mActivities.size();
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700221 for (int activityNdx = numActivities - 1; activityNdx >= 0; --activityNdx) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700222 ActivityRecord r = mActivities.get(activityNdx);
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700223 if (r.finishing) {
224 continue;
225 }
226 if (r.realActivity.equals(newR.realActivity)) {
227 // Here it is! Now finish everything in front...
Craig Mautner1602ec22013-05-12 10:24:27 -0700228 final ActivityRecord ret = r;
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700229
230 for (++activityNdx; activityNdx < numActivities; ++activityNdx) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700231 r = mActivities.get(activityNdx);
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700232 if (r.finishing) {
233 continue;
234 }
235 ActivityOptions opts = r.takeOptionsLocked();
236 if (opts != null) {
237 ret.updateOptionsLocked(opts);
238 }
239 if (stack.finishActivityLocked(r, Activity.RESULT_CANCELED, null, "clear",
240 false)) {
241 --activityNdx;
242 --numActivities;
243 }
244 }
245
246 // Finally, if this is a normal launch mode (that is, not
247 // expecting onNewIntent()), then we will finish the current
248 // instance of the activity so a new fresh one can be started.
249 if (ret.launchMode == ActivityInfo.LAUNCH_MULTIPLE
250 && (launchFlags & Intent.FLAG_ACTIVITY_SINGLE_TOP) == 0) {
251 if (!ret.finishing) {
Craig Mautner1602ec22013-05-12 10:24:27 -0700252 stack.finishActivityLocked(ret, Activity.RESULT_CANCELED, null,
253 "clear", false);
Craig Mautnerb0f7dc72013-04-01 16:34:45 -0700254 return null;
255 }
256 }
257
258 return ret;
259 }
260 }
261
262 return null;
263 }
264
Craig Mautner9db9a0b2013-04-29 17:05:56 -0700265 public ActivityManager.TaskThumbnails getTaskThumbnailsLocked() {
266 TaskAccessInfo info = getTaskAccessInfoLocked(true);
267 final ActivityRecord resumedActivity = stack.mResumedActivity;
268 if (resumedActivity != null && resumedActivity.thumbHolder == this) {
269 info.mainThumbnail = stack.screenshotActivities(resumedActivity);
270 }
271 if (info.mainThumbnail == null) {
272 info.mainThumbnail = lastThumbnail;
273 }
274 return info;
275 }
276
277 public Bitmap getTaskTopThumbnailLocked() {
278 final ActivityRecord resumedActivity = stack.mResumedActivity;
279 if (resumedActivity != null && resumedActivity.task == this) {
280 // This task is the current resumed task, we just need to take
281 // a screenshot of it and return that.
282 return stack.screenshotActivities(resumedActivity);
283 }
284 // Return the information about the task, to figure out the top
285 // thumbnail to return.
286 TaskAccessInfo info = getTaskAccessInfoLocked(true);
287 if (info.numSubThumbbails <= 0) {
288 return info.mainThumbnail != null ? info.mainThumbnail : lastThumbnail;
289 }
290 return info.subtasks.get(info.numSubThumbbails-1).holder.lastThumbnail;
291 }
292
293 public ActivityRecord removeTaskActivitiesLocked(int subTaskIndex,
294 boolean taskRequired) {
295 TaskAccessInfo info = getTaskAccessInfoLocked(false);
296 if (info.root == null) {
297 if (taskRequired) {
298 Slog.w(TAG, "removeTaskLocked: unknown taskId " + taskId);
299 }
300 return null;
301 }
302
303 if (subTaskIndex < 0) {
304 // Just remove the entire task.
305 performClearTaskAtIndexLocked(info.rootIndex);
306 return info.root;
307 }
308
309 if (subTaskIndex >= info.subtasks.size()) {
310 if (taskRequired) {
311 Slog.w(TAG, "removeTaskLocked: unknown subTaskIndex " + subTaskIndex);
312 }
313 return null;
314 }
315
316 // Remove all of this task's activities starting at the sub task.
317 TaskAccessInfo.SubTask subtask = info.subtasks.get(subTaskIndex);
318 performClearTaskAtIndexLocked(subtask.index);
319 return subtask.activity;
320 }
321
Craig Mautner86d67a42013-05-14 10:34:38 -0700322 boolean isApplicationTask() {
323 return mApplicationTask;
Craig Mautner1602ec22013-05-12 10:24:27 -0700324 }
325
Craig Mautner9db9a0b2013-04-29 17:05:56 -0700326 public TaskAccessInfo getTaskAccessInfoLocked(boolean inclThumbs) {
327 final TaskAccessInfo thumbs = new TaskAccessInfo();
328 // How many different sub-thumbnails?
329 final int NA = mActivities.size();
330 int j = 0;
331 ThumbnailHolder holder = null;
332 while (j < NA) {
333 ActivityRecord ar = mActivities.get(j);
334 if (!ar.finishing) {
335 thumbs.root = ar;
336 thumbs.rootIndex = j;
337 holder = ar.thumbHolder;
338 if (holder != null) {
339 thumbs.mainThumbnail = holder.lastThumbnail;
340 }
341 j++;
342 break;
343 }
344 j++;
345 }
346
347 if (j >= NA) {
348 return thumbs;
349 }
350
351 ArrayList<TaskAccessInfo.SubTask> subtasks = new ArrayList<TaskAccessInfo.SubTask>();
352 thumbs.subtasks = subtasks;
353 while (j < NA) {
354 ActivityRecord ar = mActivities.get(j);
355 j++;
356 if (ar.finishing) {
357 continue;
358 }
359 if (ar.thumbHolder != holder && holder != null) {
360 thumbs.numSubThumbbails++;
361 holder = ar.thumbHolder;
362 TaskAccessInfo.SubTask sub = new TaskAccessInfo.SubTask();
363 sub.holder = holder;
364 sub.activity = ar;
365 sub.index = j-1;
366 subtasks.add(sub);
367 }
368 }
369 if (thumbs.numSubThumbbails > 0) {
370 thumbs.retriever = new IThumbnailRetriever.Stub() {
371 @Override
372 public Bitmap getThumbnail(int index) {
373 if (index < 0 || index >= thumbs.subtasks.size()) {
374 return null;
375 }
376 TaskAccessInfo.SubTask sub = thumbs.subtasks.get(index);
377 ActivityRecord resumedActivity = stack.mResumedActivity;
378 if (resumedActivity != null && resumedActivity.thumbHolder == sub.holder) {
379 return stack.screenshotActivities(resumedActivity);
380 }
381 return sub.holder.lastThumbnail;
382 }
383 };
384 }
385 return thumbs;
386 }
387
Craig Mautner525f3d92013-05-07 14:01:50 -0700388 /**
389 * Find the activity in the history stack within the given task. Returns
390 * the index within the history at which it's found, or < 0 if not found.
391 */
392 final ActivityRecord findActivityInHistoryLocked(ActivityRecord r) {
393 final ComponentName realActivity = r.realActivity;
394 for (int activityNdx = mActivities.size() - 1; activityNdx >= 0; --activityNdx) {
395 ActivityRecord candidate = mActivities.get(activityNdx);
396 if (candidate.finishing) {
397 continue;
398 }
399 if (candidate.realActivity.equals(realActivity)) {
400 return candidate;
401 }
402 }
403 return null;
404 }
405
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800406 void dump(PrintWriter pw, String prefix) {
Dianne Hackborn7f96b792012-05-29 18:46:45 -0700407 if (numActivities != 0 || rootWasReset || userId != 0) {
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800408 pw.print(prefix); pw.print("numActivities="); pw.print(numActivities);
Dianne Hackborn7f96b792012-05-29 18:46:45 -0700409 pw.print(" rootWasReset="); pw.print(rootWasReset);
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800410 pw.print(" userId="); pw.print(userId);
411 pw.print(" numFullscreen="); pw.println(numFullscreen);
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700412 }
413 if (affinity != null) {
414 pw.print(prefix); pw.print("affinity="); pw.println(affinity);
415 }
416 if (intent != null) {
417 StringBuilder sb = new StringBuilder(128);
418 sb.append(prefix); sb.append("intent={");
Dianne Hackborn21c241e2012-03-08 13:57:23 -0800419 intent.toShortString(sb, false, true, false, true);
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700420 sb.append('}');
421 pw.println(sb.toString());
422 }
423 if (affinityIntent != null) {
424 StringBuilder sb = new StringBuilder(128);
425 sb.append(prefix); sb.append("affinityIntent={");
Dianne Hackborn21c241e2012-03-08 13:57:23 -0800426 affinityIntent.toShortString(sb, false, true, false, true);
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700427 sb.append('}');
428 pw.println(sb.toString());
429 }
430 if (origActivity != null) {
431 pw.print(prefix); pw.print("origActivity=");
432 pw.println(origActivity.flattenToShortString());
433 }
434 if (realActivity != null) {
435 pw.print(prefix); pw.print("realActivity=");
436 pw.println(realActivity.flattenToShortString());
437 }
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800438 pw.print(prefix); pw.print("Activities="); pw.println(mActivities);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -0700439 if (!askedCompatMode) {
440 pw.print(prefix); pw.print("askedCompatMode="); pw.println(askedCompatMode);
441 }
Dianne Hackborncfb9f2b2011-08-24 10:51:49 -0700442 pw.print(prefix); pw.print("lastThumbnail="); pw.print(lastThumbnail);
443 pw.print(" lastDescription="); pw.println(lastDescription);
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700444 pw.print(prefix); pw.print("lastActiveTime="); pw.print(lastActiveTime);
445 pw.print(" (inactive for ");
446 pw.print((getInactiveDuration()/1000)); pw.println("s)");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800447 }
448
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800449 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800450 public String toString() {
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700451 StringBuilder sb = new StringBuilder(128);
Craig Mautnerde4ef022013-04-07 19:01:33 -0700452 if (stringName != null) {
453 sb.append(stringName);
454 sb.append(" U=");
455 sb.append(userId);
456 sb.append(" sz=");
457 sb.append(mActivities.size());
458 sb.append('}');
459 return sb.toString();
460 }
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700461 sb.append("TaskRecord{");
462 sb.append(Integer.toHexString(System.identityHashCode(this)));
463 sb.append(" #");
464 sb.append(taskId);
465 if (affinity != null) {
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800466 sb.append(" A=");
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700467 sb.append(affinity);
468 } else if (intent != null) {
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800469 sb.append(" I=");
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700470 sb.append(intent.getComponent().flattenToShortString());
471 } else if (affinityIntent != null) {
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800472 sb.append(" aI=");
Dianne Hackborn1d442e02009-04-20 18:14:05 -0700473 sb.append(affinityIntent.getComponent().flattenToShortString());
474 } else {
475 sb.append(" ??");
476 }
Craig Mautnerde4ef022013-04-07 19:01:33 -0700477 stringName = sb.toString();
478 return toString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800479 }
480}