Skip to content
Commit ef96992b authored by Jeongsik Mun's avatar Jeongsik Mun Committed by Todd Kennedy
Browse files

Fix an app data removal issue during OTA update

There is an edge case where an OTA updates a system app to
a higher version than a version of an upgrade on /data and
reset happens for unknown reason right after removing the apk of
the upgrade on /data. PackageManager cleans up orphaned packages ahead
of scanning when it happens. However, it gets 'duplicated appId'
error in enableSystemPackageLPw() and it ends up changing
the appId and removing app's data dir.

This fix removes the code to clean up orphaned packages, which is
a fix for b/32321269.

Test: manual
  1. Command to install an apk(version 1) as system app.
    $ adb remount; adb shell mkdir /system/app/Test \
      adb push Test_v1.apk /system/app/Test/Test.apk \
      adb reboot
  2. Command to update it with an apk(v2)
    $ adb install Test_v2.apk
  3. Command to simulate an OTA, rebooted after removing Test_v2.apk
    $ adb remount; adb push Test_v3.apk /system/app/Test/Test.apk \
      adb shell rm -rf [codepath_of_test_v2]; adb reboot
  4. Check the appId didn't change and app data wasn't removed
Bug: 162757159
Change-Id: I4544316e99247ae1de1228d5fe11416cfb601849
parent 99abec3d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment