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

Commit 9ba6afa3 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

don't dex when installing an instant app

Bug: 38259387
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Test: install an instant app, see that it doesn't dex
Test: install a full app, see that it does dex
Change-Id: Id7dc749954d0be24bbd80da2ef0f43e39f77993e
parent 9e6ef496
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -17445,6 +17445,12 @@ public class PackageManagerService extends IPackageManager.Stub
                }
            }
            // dexopt can take some time to complete, so, for instant apps, we skip this
            // step during installation. Instead, we'll take extra time the first time the
            // instant app starts. It's preferred to do it this way to provide continuous
            // progress to the user instead of mysteriously blocking somewhere in the
            // middle of running an instant app.
            if (!instantApp) {
                Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
                // Do not run PackageDexOptimizer through the local performDexOpt
                // method because `pkg` may not be in `mPackages` yet.
@@ -17456,6 +17462,7 @@ public class PackageManagerService extends IPackageManager.Stub
                        getOrCreateCompilerPackageStats(pkg),
                        mDexManager.isUsedByOtherApps(pkg.packageName));
                Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
            }
            // Notify BackgroundDexOptService that the package has been changed.
            // If this is an update of a package which used to fail to compile,