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

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

Add special path for system server dex file reconciliation

We need a special path for system server dex file reconcilliation.
- we cannot use the application info to extract the arguments
for the installd call
- but we can use normal file checks because the system server has
the right permission.

Test: DexManagerTests, manual
Bug: 148774920
Change-Id: Ic63aee129d10f6905cecbdba1feeb0320ee0ca1c
parent 136c1428
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -600,6 +600,23 @@ public class DexManager {
                        packageName, dexUseInfo.getOwnerUserId()) || updated;
                continue;
            }

            // Special handle system server files.
            // We don't need an installd call because we have permissions to check if the file
            // exists.
            if (PLATFORM_PACKAGE_NAME.equals(packageName)) {
                if (!Files.exists(Paths.get(dexPath))) {
                    if (DEBUG) {
                        Slog.w(TAG, "A dex file previously loaded by System Server does not exist "
                                + " anymore: " + dexPath);
                    }
                    updated = mPackageDexUsage.removeUserPackage(
                            packageName, dexUseInfo.getOwnerUserId()) || updated;
                }
                continue;
            }

            // This is a regular application.
            ApplicationInfo info = pkg.applicationInfo;
            int flags = 0;
            if (info.deviceProtectedDataDir != null &&