Loading services/core/java/com/android/server/pm/ComputerEngine.java +1 −0 Original line number Diff line number Diff line Loading @@ -1519,6 +1519,7 @@ public class ComputerEngine implements Computer { ai.privateFlags = ps.getPrivateFlags(); pi.applicationInfo = PackageInfoUtils.generateDelegateApplicationInfo( ai, flags, state, userId); pi.signingInfo = ps.getSigningInfo(); if (DEBUG_PACKAGE_INFO) { Log.v(TAG, "ps.pkg is n/a for [" Loading services/core/java/com/android/server/pm/DeletePackageHelper.java +0 −1 Original line number Diff line number Diff line Loading @@ -470,7 +470,6 @@ final class DeletePackageHelper { // We need to set it back to 'installed' so the uninstall // broadcasts will be sent correctly. if (DEBUG_REMOVE) Slog.d(TAG, "Not installed by other users, full delete"); ps.setPkg(null); ps.setInstalled(true, userId); mPm.mSettings.writeKernelMappingLPr(ps); clearPackageStateAndReturn = false; Loading services/core/java/com/android/server/pm/RemovePackageHelper.java +8 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ final class RemovePackageHelper { cacher.cleanCachedResult(codePath); } // Used for system apps only public void removePackage(AndroidPackage pkg, boolean chatty) { synchronized (mPm.mInstallLock) { removePackageLI(pkg, chatty); Loading Loading @@ -284,6 +285,13 @@ final class RemovePackageHelper { } removePackageLI(deletedPs.getPackageName(), (flags & PackageManager.DELETE_CHATTY) != 0); if (!deletedPs.isSystem()) { // A non-system app's AndroidPackage object has been removed from the service. // Explicitly nullify the corresponding app's PackageSetting's pkg object to // prevent any future usage of it, in case the PackageSetting object will remain because // of DELETE_KEEP_DATA. deletedPs.setPkg(null); } if ((flags & PackageManager.DELETE_KEEP_DATA) == 0) { final AndroidPackage resolvedPkg; Loading services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java +14 −11 Original line number Diff line number Diff line Loading @@ -966,10 +966,12 @@ public class PackageManagerTests extends AndroidTestCase { } private static void assertUninstalled(ApplicationInfo info) throws Exception { if (info.nativeLibraryDir != null) { File nativeLibraryFile = new File(info.nativeLibraryDir); assertFalse("Native library directory " + info.nativeLibraryDir + " should be erased", nativeLibraryFile.exists()); } } public void deleteFromRawResource(int iFlags, int dFlags) throws Exception { InstallParams ip = sampleInstallFromRawResource(iFlags, false); Loading Loading @@ -2883,14 +2885,15 @@ public class PackageManagerTests extends AndroidTestCase { break; } } assertNotNull("activities should not be null", packageInfo.activities); assertNotNull("configPreferences should not be null", packageInfo.configPreferences); assertNotNull("instrumentation should not be null", packageInfo.instrumentation); assertNotNull("permissions should not be null", packageInfo.permissions); assertNotNull("providers should not be null", packageInfo.providers); assertNotNull("receivers should not be null", packageInfo.receivers); assertNotNull("services should not be null", packageInfo.services); assertNotNull("signatures should not be null", packageInfo.signatures); assertNotNull("applicationInfo should not be null", packageInfo.applicationInfo); assertNull("activities should be null", packageInfo.activities); assertNull("configPreferences should be null", packageInfo.configPreferences); assertNull("instrumentation should be null", packageInfo.instrumentation); assertNull("permissions should be null", packageInfo.permissions); assertNull("providers should be null", packageInfo.providers); assertNull("receivers should be null", packageInfo.receivers); assertNull("services should be null", packageInfo.services); assertNotNull("signingInfo should not be null", packageInfo.signingInfo); } finally { cleanUpInstall(ip); } Loading Loading
services/core/java/com/android/server/pm/ComputerEngine.java +1 −0 Original line number Diff line number Diff line Loading @@ -1519,6 +1519,7 @@ public class ComputerEngine implements Computer { ai.privateFlags = ps.getPrivateFlags(); pi.applicationInfo = PackageInfoUtils.generateDelegateApplicationInfo( ai, flags, state, userId); pi.signingInfo = ps.getSigningInfo(); if (DEBUG_PACKAGE_INFO) { Log.v(TAG, "ps.pkg is n/a for [" Loading
services/core/java/com/android/server/pm/DeletePackageHelper.java +0 −1 Original line number Diff line number Diff line Loading @@ -470,7 +470,6 @@ final class DeletePackageHelper { // We need to set it back to 'installed' so the uninstall // broadcasts will be sent correctly. if (DEBUG_REMOVE) Slog.d(TAG, "Not installed by other users, full delete"); ps.setPkg(null); ps.setInstalled(true, userId); mPm.mSettings.writeKernelMappingLPr(ps); clearPackageStateAndReturn = false; Loading
services/core/java/com/android/server/pm/RemovePackageHelper.java +8 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ final class RemovePackageHelper { cacher.cleanCachedResult(codePath); } // Used for system apps only public void removePackage(AndroidPackage pkg, boolean chatty) { synchronized (mPm.mInstallLock) { removePackageLI(pkg, chatty); Loading Loading @@ -284,6 +285,13 @@ final class RemovePackageHelper { } removePackageLI(deletedPs.getPackageName(), (flags & PackageManager.DELETE_CHATTY) != 0); if (!deletedPs.isSystem()) { // A non-system app's AndroidPackage object has been removed from the service. // Explicitly nullify the corresponding app's PackageSetting's pkg object to // prevent any future usage of it, in case the PackageSetting object will remain because // of DELETE_KEEP_DATA. deletedPs.setPkg(null); } if ((flags & PackageManager.DELETE_KEEP_DATA) == 0) { final AndroidPackage resolvedPkg; Loading
services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java +14 −11 Original line number Diff line number Diff line Loading @@ -966,10 +966,12 @@ public class PackageManagerTests extends AndroidTestCase { } private static void assertUninstalled(ApplicationInfo info) throws Exception { if (info.nativeLibraryDir != null) { File nativeLibraryFile = new File(info.nativeLibraryDir); assertFalse("Native library directory " + info.nativeLibraryDir + " should be erased", nativeLibraryFile.exists()); } } public void deleteFromRawResource(int iFlags, int dFlags) throws Exception { InstallParams ip = sampleInstallFromRawResource(iFlags, false); Loading Loading @@ -2883,14 +2885,15 @@ public class PackageManagerTests extends AndroidTestCase { break; } } assertNotNull("activities should not be null", packageInfo.activities); assertNotNull("configPreferences should not be null", packageInfo.configPreferences); assertNotNull("instrumentation should not be null", packageInfo.instrumentation); assertNotNull("permissions should not be null", packageInfo.permissions); assertNotNull("providers should not be null", packageInfo.providers); assertNotNull("receivers should not be null", packageInfo.receivers); assertNotNull("services should not be null", packageInfo.services); assertNotNull("signatures should not be null", packageInfo.signatures); assertNotNull("applicationInfo should not be null", packageInfo.applicationInfo); assertNull("activities should be null", packageInfo.activities); assertNull("configPreferences should be null", packageInfo.configPreferences); assertNull("instrumentation should be null", packageInfo.instrumentation); assertNull("permissions should be null", packageInfo.permissions); assertNull("providers should be null", packageInfo.providers); assertNull("receivers should be null", packageInfo.receivers); assertNull("services should be null", packageInfo.services); assertNotNull("signingInfo should not be null", packageInfo.signingInfo); } finally { cleanUpInstall(ip); } Loading