Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c43ec93 authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug in TaskStackBuilder#addParentStack

Don't assume the initial component has a valid parent specified.

Bug 6464209

Change-Id: I22aa4c0e667ea85dc46ad7320f4a9f52117af520
parent 1705b2a5
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -196,18 +196,12 @@ public class TaskStackBuilder {
        try {
            ActivityInfo info = pm.getActivityInfo(sourceActivityName, 0);
            String parentActivity = info.parentActivityName;
            while (parentActivity != null) {
                Intent parent = new Intent().setComponent(
                        new ComponentName(info.packageName, parentActivity));
            while (parent != null) {
                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");