Hello Android, We have developed an APP and will be pre-installed as a system APP in some devices. So I have done a lot of tests about upgrade and downgrade, about how they load libraries and how they save data. Now I have a question about uninstall updates. My test is based on Android 4.0 emulator and steps are: 1, Put MyApp_v1.0.apk in /system/app, put necessary libraries in /system/lib. Then MyApp is installed as a system APP. 2, Use command: adb install -r MyApp_v2.0.apk, to upgrade the APP. It's successful, and all the data in /data/data/MyApp are kept unchanged, further more, the new libraries in MyApp_v2.0.apk are installed in /data/data/MyApp/lib. 3, Go to System Setting -> App -> Manage Application, select MyApp, Tap "Uninstall Updates", to downgrade it to the system APP MyApp_v1.0. It's suecessful.
But I find in Step 3, when I uninstall updates, the data in /data/data/MyApp are still there, only change is that, the /data/data/MyApp/lib fold gets emptied. That's a little bit of strange to me. My questions are: 1, I have checked different versions(2.1, 2.3.3, 4.0.1) of Android source code, in PackageManagerServce.java, follow the call flow of deleteSystemPackageLI(), the package data folder should be deleted in function removePackageDataLI(), mInstaller.remove(packageName, 0); Why the test result is different as expected? 2, If the behavior - keeping the data unchanged when uninstalling updates, is as designed, that maybe cause some problems. Imaging I add some new configuration item, or change the configuration structure in the new version, after downgrade to old version, this new configuration will not be recognized by the pre-installed system APP. The result is unknown. So can you take a look and explain? Please correct me if my understanding is wrong. Thank you. Cruise -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en