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

Commit 6bdc7e1c authored by Chong Zhang's avatar Chong Zhang
Browse files

Fix FLAG_ACTIVITY_CLEAR_TOP not working for aliased activities

bug: 26216591
Change-Id: I26528b7613bd8aa80fc7f4d6b64ea7bf639935d3
parent 84867864
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -584,13 +584,16 @@ final class ActivityRecord {
        haveState = true;

        if (aInfo != null) {
            // If the class name in the intent doesn't match that of the target, this is
            // probably an alias. We have to create a new ComponentName object to keep track
            // of the real activity name, so that FLAG_ACTIVITY_CLEAR_TOP is handled properly.
            if (aInfo.targetActivity == null
                    || aInfo.launchMode == ActivityInfo.LAUNCH_MULTIPLE
                    || aInfo.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP) {
                    || (aInfo.targetActivity.equals(_intent.getComponent().getClassName())
                    && (aInfo.launchMode == ActivityInfo.LAUNCH_MULTIPLE
                    || aInfo.launchMode == ActivityInfo.LAUNCH_SINGLE_TOP))) {
                realActivity = _intent.getComponent();
            } else {
                realActivity = new ComponentName(aInfo.packageName,
                        aInfo.targetActivity);
                realActivity = new ComponentName(aInfo.packageName, aInfo.targetActivity);
            }
            taskAffinity = aInfo.taskAffinity;
            stateNotNeeded = (aInfo.flags&