Commit Graph

2 Commits

Author SHA1 Message Date
Felka Chang
33025c4514 Fix fail verification without cleaning child session data
When a multipackage session is verified to fail, destroyInternal() is
only called for the parent session. However, the child session
doesn't call destroyInternal(). It makes the child session data
occupy the storage space. The device user can't get the storage
space back except to execute factory reset or root the device.

This patch calls destroyInternal() for all of child sessions if the
verification failed.

This patch also creates a new test that needs a rooted device. The
test verifies that the child session stage dir is cleaned.
* using "dumpsys package" to get stage dir
* using "su root" to check the stage dir exist or not so it needs a
  rooted device

Test: TID="PackageManagerServiceHostTests"; \
      TC="com.android.server.pm.test.PackageInstallerSessionTest"; \
      atest "${TID}:${TC}"
Fix: 196522826
Change-Id: Ice257df8dd541c7ca732279ddf0353e6fde83e64
2021-08-16 14:31:48 +08:00
Winson
af8399a682 Fix original-package support
This broke in P. Basic support was broken by a simple negation
issue with the logic that checks for the original package.

That, along with the suggestion in the bug to fix the renamed
package association means this should now work as expected,
carrying data over from a previous installed, differently named
package.

Bug: 131355130
Bug: 132749720
Bug: 111967720

Test: atest PackageManagerServiceHostTests

Change-Id: Ifc4c7af47c4b633cd27ba4a40b6baa0e27960d71
2020-06-10 10:34:43 -07:00