OSDN Git Service

Dexopt for Context.createPackageContext when code is included.
authorNarayan Kamath <narayan@google.com>
Mon, 14 Jul 2014 12:18:43 +0000 (13:18 +0100)
committerNarayan Kamath <narayan@google.com>
Wed, 16 Jul 2014 18:23:52 +0000 (19:23 +0100)
commit2053168eb4506e2f8795afdbe9731c6451e1589c
tree876def8c6e4a36ad5dfc2e51fe6beb18e317f608
parent93a412ea39cb585dc8e0fa97936c1d0925d0993b
Dexopt for Context.createPackageContext when code is included.

The package manager now keeps track of per ISA dex-opt state.

There are two important things to keep in mind here :

- dexopt can potentially be very slow. In cases where the target
  package hasn't been dexopted yet, this can take multiple seconds
  and may cause an ANR in the caller if the context is being
  created from the main thread.
- We will need to remove the constraint that dexopt can only be
  requested by the system (or root). Apps will implicitly be
  requesting dexopt by asking for package contexts with code included.
  It's important to note that unlike dalvik, the dexopt stage in ART
  isn't optional. ART cannot load classes directly from dex files.

bug: 15313272
Change-Id: I0bd6c323a9c1f62f1c08f6292b7f0f7f08942726
core/java/android/app/LoadedApk.java
core/java/android/content/pm/IPackageManager.aidl
core/java/android/content/pm/PackageParser.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/pm/BackgroundDexOptService.java
services/core/java/com/android/server/pm/PackageManagerService.java