David 'Digit' Turner 4f99e3c284 Remove native binaries when an updated system application is upgraded through OTA.
The point of this patch is to deal with the following case:

- A system application exists in the system partition. As such its
  native code lies under /system/lib

- An upgrade for it is installed through Market and overrides the
  version on the system partition. This places its native libraries
  under /data/data/<pkgname>/lib/

- Finally, the system is upgraded through an OTA, with an even more
  recent of the system application. We thus must remove the Market
  package as well as the native libraries that are in <dataDir>/lib
  since the new versions in /system/lib will be more recent.

The patch itself removes the files in <dataDir>/lib when such a
situation is detected. Note that this directory is created by the
PackageManager service and owned by the 'system' userID. The application
cannot create files there so simply erasing the content of the directory
is enough (and avoids reparsing the market package file to list
the installed binaries).

The patch also fixes a different issue which can be reproduced with:

- have system app installed on /system partition
- install an update (e.g. adb install -r Term.apk)
- uninstall the update (e.g. adb uninstall com.android.term)

the logcat shows that the PackageManager will unpack the native libraries
from the original /system/app/Term.apk into <dataDir>/lib, while they
already are in /system/lib. The patch fixes that too.

Change-Id: I5dfe27b91b6b31972e9cd4c196d15c3692732127
2010-04-15 10:35:25 -07:00
2010-04-14 22:08:29 -07:00
2010-04-01 18:31:11 -07:00
2010-03-16 09:59:06 -07:00
2010-04-08 14:55:24 -07:00
2010-03-29 18:12:24 -07:00
2010-04-01 12:05:26 -07:00
Description
No description provided
5.1 GiB
Languages
Java 77.3%
Kotlin 9.2%
PowerBuilder 6.6%
C++ 5.5%
AIDL 1%