OSDN Git Service

Ensure dexopt is executed only with consistent package data
authorCalin Juravle <calin@google.com>
Fri, 11 Aug 2017 00:23:00 +0000 (17:23 -0700)
committerAndreas Gampe <agampe@google.com>
Thu, 2 Nov 2017 16:22:28 +0000 (09:22 -0700)
commit563a5cad666555b8bed26fb4eb01c9bd20c2421a
treefde84e140f111e8e1a3548279206155a136e807e
parentdfe472ecae7783040491b2fadc5a14ad8e9bff6c
Ensure dexopt is executed only with consistent package data

The main objects bookkeeping packages (PackageParser.Package and its
corresponding ApplicationInfo) may be updated at different times. This
creates a window where the data stored in the ApplicationInfo is out of
date with respect to the data stored in PackageParser.Package.

During install, the two objects are "synced" during doRename which updates
the package code paths.

This CLs moves the dexopt invocation from the install flow after doRename
to ensure that dexopt logic gets a consistent view of the package.

(cherry picked from commit 4c2b9555b7b52359ea14e201d7ec61b8edaf6232)

Bug: 64493351

Test: run cts-dev -t android.appsecurity.cts.ClassloaderSplitsTest -m
CtsAppSecurityHostTestCases
      inspect oat files after
adb install-multiple CtsClassloaderSplitApp/CtsClassloaderSplitApp.apk
    CtsClassloaderSplitAppFeatureA/CtsClassloaderSplitAppFeatureA.apk
    CtsClassloaderSplitAppFeatureB/CtsClassloaderSplitAppFeatureB.apk

Merged-In: I9131bcf49eb473a8fdc5eb0032d94080d4e9e94b
Change-Id: I9131bcf49eb473a8fdc5eb0032d94080d4e9e94b
services/core/java/com/android/server/pm/PackageDexOptimizer.java
services/core/java/com/android/server/pm/PackageManagerService.java