Loading services/core/java/com/android/server/pm/Installer.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,8 +169,12 @@ public final class Installer extends SystemService { mInstaller.execute("rmpackagedir", packageDir); } public void rmProfiles(String pkgName) throws InstallerException { mInstaller.execute("rmprofiles", pkgName); public void clearAppProfiles(String pkgName) throws InstallerException { mInstaller.execute("clear_app_profiles", pkgName); } public void destroyAppProfiles(String pkgName) throws InstallerException { mInstaller.execute("destroy_app_profiles", pkgName); } public void createUserConfig(int userid) throws InstallerException { Loading services/core/java/com/android/server/pm/PackageManagerService.java +28 −1 Original line number Diff line number Diff line Loading @@ -7203,6 +7203,30 @@ public class PackageManagerService extends IPackageManager.Stub { } } private void deleteProfilesLI(String packageName, boolean destroy) { final PackageParser.Package pkg; synchronized (mPackages) { pkg = mPackages.get(packageName); } if (pkg == null) { Slog.w(TAG, "Failed to delete profiles. No package: " + packageName); return; } deleteProfilesLI(pkg, destroy); } private void deleteProfilesLI(PackageParser.Package pkg, boolean destroy) { try { if (destroy) { mInstaller.clearAppProfiles(pkg.packageName); } else { mInstaller.destroyAppProfiles(pkg.packageName); } } catch (InstallerException ex) { Log.e(TAG, "Could not delete profiles for package " + pkg.packageName); } } private void deleteCodeCacheDirsLI(String volumeUuid, String packageName) { final PackageParser.Package pkg; synchronized (mPackages) { Loading Loading @@ -13235,6 +13259,7 @@ public class PackageManagerService extends IPackageManager.Stub { } deleteCodeCacheDirsLI(pkg); deleteProfilesLI(pkg, /*destroy*/ false); try { final PackageParser.Package newPackage = scanPackageTracedLI(pkg, parseFlags, Loading Loading @@ -13369,6 +13394,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Successfully disabled the old package. Now proceed with re-installation deleteCodeCacheDirsLI(pkg); deleteProfilesLI(pkg, /*destroy*/ false); res.setReturnCode(PackageManager.INSTALL_SUCCEEDED); pkg.setApplicationInfoFlags(ApplicationInfo.FLAG_UPDATED_SYSTEM_APP, Loading Loading @@ -14441,6 +14467,7 @@ public class PackageManagerService extends IPackageManager.Stub { if (DEBUG_REMOVE) Slog.d(TAG, "deletePackageX: pkg=" + packageName + " user=" + userId); res = deletePackageLI(packageName, removeForUser, true, allUsers, flags | REMOVE_CHATTY, info, true, null); deleteProfilesLI(packageName, /*destroy*/ true); synchronized (mPackages) { if (res) { mEphemeralApplicationRegistry.onPackageUninstalledLPw(uninstalledPs.pkg); Loading Loading @@ -15208,7 +15235,7 @@ public class PackageManagerService extends IPackageManager.Stub { public void clearApplicationProfileData(String packageName) { enforceSystemOrRoot("Only the system can clear all profile data"); try { mInstaller.rmProfiles(packageName); mInstaller.clearAppProfiles(packageName); } catch (InstallerException ex) { Log.e(TAG, "Could not clear profile data of package " + packageName); } Loading
services/core/java/com/android/server/pm/Installer.java +6 −2 Original line number Diff line number Diff line Loading @@ -169,8 +169,12 @@ public final class Installer extends SystemService { mInstaller.execute("rmpackagedir", packageDir); } public void rmProfiles(String pkgName) throws InstallerException { mInstaller.execute("rmprofiles", pkgName); public void clearAppProfiles(String pkgName) throws InstallerException { mInstaller.execute("clear_app_profiles", pkgName); } public void destroyAppProfiles(String pkgName) throws InstallerException { mInstaller.execute("destroy_app_profiles", pkgName); } public void createUserConfig(int userid) throws InstallerException { Loading
services/core/java/com/android/server/pm/PackageManagerService.java +28 −1 Original line number Diff line number Diff line Loading @@ -7203,6 +7203,30 @@ public class PackageManagerService extends IPackageManager.Stub { } } private void deleteProfilesLI(String packageName, boolean destroy) { final PackageParser.Package pkg; synchronized (mPackages) { pkg = mPackages.get(packageName); } if (pkg == null) { Slog.w(TAG, "Failed to delete profiles. No package: " + packageName); return; } deleteProfilesLI(pkg, destroy); } private void deleteProfilesLI(PackageParser.Package pkg, boolean destroy) { try { if (destroy) { mInstaller.clearAppProfiles(pkg.packageName); } else { mInstaller.destroyAppProfiles(pkg.packageName); } } catch (InstallerException ex) { Log.e(TAG, "Could not delete profiles for package " + pkg.packageName); } } private void deleteCodeCacheDirsLI(String volumeUuid, String packageName) { final PackageParser.Package pkg; synchronized (mPackages) { Loading Loading @@ -13235,6 +13259,7 @@ public class PackageManagerService extends IPackageManager.Stub { } deleteCodeCacheDirsLI(pkg); deleteProfilesLI(pkg, /*destroy*/ false); try { final PackageParser.Package newPackage = scanPackageTracedLI(pkg, parseFlags, Loading Loading @@ -13369,6 +13394,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Successfully disabled the old package. Now proceed with re-installation deleteCodeCacheDirsLI(pkg); deleteProfilesLI(pkg, /*destroy*/ false); res.setReturnCode(PackageManager.INSTALL_SUCCEEDED); pkg.setApplicationInfoFlags(ApplicationInfo.FLAG_UPDATED_SYSTEM_APP, Loading Loading @@ -14441,6 +14467,7 @@ public class PackageManagerService extends IPackageManager.Stub { if (DEBUG_REMOVE) Slog.d(TAG, "deletePackageX: pkg=" + packageName + " user=" + userId); res = deletePackageLI(packageName, removeForUser, true, allUsers, flags | REMOVE_CHATTY, info, true, null); deleteProfilesLI(packageName, /*destroy*/ true); synchronized (mPackages) { if (res) { mEphemeralApplicationRegistry.onPackageUninstalledLPw(uninstalledPs.pkg); Loading Loading @@ -15208,7 +15235,7 @@ public class PackageManagerService extends IPackageManager.Stub { public void clearApplicationProfileData(String packageName) { enforceSystemOrRoot("Only the system can clear all profile data"); try { mInstaller.rmProfiles(packageName); mInstaller.clearAppProfiles(packageName); } catch (InstallerException ex) { Log.e(TAG, "Could not clear profile data of package " + packageName); }