Loading services/core/java/com/android/server/pm/PackageManagerService.java +0 −8 Original line number Diff line number Diff line Loading @@ -6675,15 +6675,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService @Deprecated public void legacyDumpProfiles(String packageName, boolean dumpClassesAndMethods) throws LegacyDexoptDisabledException { /* Only the shell, root, or the app user should be able to dump profiles. */ final int callingUid = Binder.getCallingUid(); final Computer snapshot = snapshotComputer(); final String[] callerPackageNames = snapshot.getPackagesForUid(callingUid); if (!PackageManagerServiceUtils.isRootOrShell(callingUid) && !ArrayUtils.contains(callerPackageNames, packageName)) { throw new SecurityException("dumpProfiles"); } AndroidPackage pkg = snapshot.getPackage(packageName); if (pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); Loading services/core/java/com/android/server/pm/PackageManagerShellCommand.java +5 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,11 @@ class PackageManagerShellCommand extends ShellCommand { private int runLegacyDexoptCommand(@NonNull String cmd) throws RemoteException, LegacyDexoptDisabledException { Installer.checkLegacyDexoptDisabled(); if (!PackageManagerServiceUtils.isRootOrShell(Binder.getCallingUid())) { throw new SecurityException("Dexopt shell commands need root or shell access"); } switch (cmd) { case "compile": return runCompile(); Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +0 −8 Original line number Diff line number Diff line Loading @@ -6675,15 +6675,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService @Deprecated public void legacyDumpProfiles(String packageName, boolean dumpClassesAndMethods) throws LegacyDexoptDisabledException { /* Only the shell, root, or the app user should be able to dump profiles. */ final int callingUid = Binder.getCallingUid(); final Computer snapshot = snapshotComputer(); final String[] callerPackageNames = snapshot.getPackagesForUid(callingUid); if (!PackageManagerServiceUtils.isRootOrShell(callingUid) && !ArrayUtils.contains(callerPackageNames, packageName)) { throw new SecurityException("dumpProfiles"); } AndroidPackage pkg = snapshot.getPackage(packageName); if (pkg == null) { throw new IllegalArgumentException("Unknown package: " + packageName); Loading
services/core/java/com/android/server/pm/PackageManagerShellCommand.java +5 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,11 @@ class PackageManagerShellCommand extends ShellCommand { private int runLegacyDexoptCommand(@NonNull String cmd) throws RemoteException, LegacyDexoptDisabledException { Installer.checkLegacyDexoptDisabled(); if (!PackageManagerServiceUtils.isRootOrShell(Binder.getCallingUid())) { throw new SecurityException("Dexopt shell commands need root or shell access"); } switch (cmd) { case "compile": return runCompile(); Loading