summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2012-05-08 16:55:20 -0700
committerAdam Powell <adamp@google.com>2012-05-08 16:55:20 -0700
commit5c43ec9328ba98fa88acc452b140f2d682a3042c (patch)
tree67b8cdb5db0be009d27e1d0b851761246b35f736 /core/java/android/app
parent1705b2a5da8f27bf91fb5bd984c212c9476fc605 (diff)
downloadframeworks_base-5c43ec9328ba98fa88acc452b140f2d682a3042c.zip
frameworks_base-5c43ec9328ba98fa88acc452b140f2d682a3042c.tar.gz
frameworks_base-5c43ec9328ba98fa88acc452b140f2d682a3042c.tar.bz2
Fix bug in TaskStackBuilder#addParentStack
Don't assume the initial component has a valid parent specified. Bug 6464209 Change-Id: I22aa4c0e667ea85dc46ad7320f4a9f52117af520
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/TaskStackBuilder.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/core/java/android/app/TaskStackBuilder.java b/core/java/android/app/TaskStackBuilder.java
index e546f6c..14c5736 100644
--- a/core/java/android/app/TaskStackBuilder.java
+++ b/core/java/android/app/TaskStackBuilder.java
@@ -196,18 +196,12 @@ public class TaskStackBuilder {
try {
ActivityInfo info = pm.getActivityInfo(sourceActivityName, 0);
String parentActivity = info.parentActivityName;
- Intent parent = new Intent().setComponent(
- new ComponentName(info.packageName, parentActivity));
- while (parent != null) {
+ while (parentActivity != null) {
+ Intent parent = new Intent().setComponent(
+ new ComponentName(info.packageName, parentActivity));
mIntents.add(insertAt, parent);
info = pm.getActivityInfo(parent.getComponent(), 0);
parentActivity = info.parentActivityName;
- if (parentActivity != null) {
- parent = new Intent().setComponent(
- new ComponentName(info.packageName, parentActivity));
- } else {
- parent = null;
- }
}
} catch (NameNotFoundException e) {
Log.e(TAG, "Bad ComponentName while traversing activity parent metadata");