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

Commit bf07e2a1 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

LoadedApk: Notify cross-package use only when code is requested.

Cross-package use is quite common when only resources are being
considered. A common example is that any application that declares
itself <searchable /> will see cross package resource only use from
the system_server.

Test: manual instrumentation.
Change-Id: Ic7ad166c71a23c6026f4e12bb52309a50210aaaf
parent a5af24cd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -597,8 +597,7 @@ public final class LoadedApk {
        // Avoid the binder call when the package is the current application package.
        // The activity manager will perform ensure that dexopt is performed before
        // spinning up the process.
        if (!Objects.equals(mPackageName, ActivityThread.currentPackageName())) {
            VMRuntime.getRuntime().vmInstructionSet();
        if (!Objects.equals(mPackageName, ActivityThread.currentPackageName()) && mIncludeCode) {
            try {
                ActivityThread.getPackageManager().notifyPackageUse(mPackageName,
                        PackageManager.NOTIFY_PACKAGE_USE_CROSS_PACKAGE);