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

Commit 60e9a234 authored by Jakob Schneider's avatar Jakob Schneider
Browse files

Only check for archived activities if the application info cannot be

found.

This ensure latency for normal activity starts is unaffected.

Test: ActivityStarterTests
Bug: 317879032
Change-Id: I9efdbac6f7b3cb4f6625cc75d698ce142e35f997
parent 06f9a781
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -983,17 +983,6 @@ class ActivityStarter {
            }
        }

        if (Flags.archiving()) {
            PackageArchiver packageArchiver = mService
                    .getPackageManagerInternalLocked()
                    .getPackageArchiver();
            if (packageArchiver.isIntentResolvedToArchivedApp(intent, mRequest.userId)) {
                return packageArchiver
                        .requestUnarchiveOnActivityStart(
                                intent, callingPackage, mRequest.userId, realCallingUid);
            }
        }

        final int launchFlags = intent.getFlags();
        if ((launchFlags & Intent.FLAG_ACTIVITY_FORWARD_RESULT) != 0 && sourceRecord != null) {
            // Transfer the result target from the source activity to the new one being started,
@@ -1035,6 +1024,17 @@ class ActivityStarter {
        }

        if (err == ActivityManager.START_SUCCESS && aInfo == null) {
            if (Flags.archiving()) {
                PackageArchiver packageArchiver = mService
                        .getPackageManagerInternalLocked()
                        .getPackageArchiver();
                if (packageArchiver.isIntentResolvedToArchivedApp(intent, mRequest.userId)) {
                    return packageArchiver
                            .requestUnarchiveOnActivityStart(
                                    intent, callingPackage, mRequest.userId, realCallingUid);
                }
            }

            // We couldn't find the specific class specified in the Intent.
            // Also the end of the line.
            err = ActivityManager.START_CLASS_NOT_FOUND;