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

Commit f4a6ba88 authored by Calin Juravle's avatar Calin Juravle
Browse files

Enforce system/root/shell for dexopt operation.

Dexopt acquires system level locks (e.g. installd locks) so it should
not be called by artbitrary apps via `adb shell` commands.

Test: manual
Bug: 180652564
Change-Id: I385d5346df7721d95edf40c45d06b969870e4bda
parent a5786a15
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9962,6 +9962,8 @@ public class PackageManagerService extends IPackageManager.Stub
    public boolean performDexOptMode(String packageName,
            boolean checkProfiles, String targetCompilerFilter, boolean force,
            boolean bootComplete, String splitName) {
        enforceSystemOrRootOrShell("performDexOptMode");
        int flags = (checkProfiles ? DexoptOptions.DEXOPT_CHECK_FOR_PROFILES_UPDATES : 0) |
                (force ? DexoptOptions.DEXOPT_FORCE : 0) |
                (bootComplete ? DexoptOptions.DEXOPT_BOOT_COMPLETE : 0);