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
6 files changed