History log of /frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
52a452cf685c56dc6872dbb19e822736484f672f 04-Aug-2017 Calin Juravle <calin@google.com> Record usage information per split

Increase the granularity of usage information to store data on each split
separately.

Now, splits get their own useByOtherApps flag and can be compiled
speed-profile when only the primary apk is loaded by other apps.

Bug: 64124380
Test: runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/*

Change-Id: Ibf9e7b9e67db9c6f0f45dc695bce8fbeb7be20ae
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
14876bd21a4a4e7d78d36f910493269f14b2e905 29-Jul-2017 Calin Juravle <calin@google.com> Save PackageDexUsage on PMS shutdown

This ensures that we persist the in memory data between restarts (makes
testing much easier).

Bug: 64151900
Test: Manual, flash + restart + check the dex usage file

(cherry picked from commit 6ef7f0b8c6e72e849a220513425a9fd37804af90)

Change-Id: I7bd99fc03c3a40cbbf5d615886f857b5f84f438c
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
f1ff36f0f99ebb41d0c7e0f3248506a56998fa3f 22-Jul-2017 Calin Juravle <calin@google.com> Use the class loader context when optimizing secondary dex files

Record the class loader context for secondary dex loads and pass it to
dexopt during compilation.

The class loader context is passed from libcore every time a
BaseDexClassLoader is created and its recorded in the package dex usage
file.

Note that the context may be:
- unknown: if the dex file was not use after the the upgrade and its
context was not yet updated
- unsupported: if any of the class loaders from the loading context is
unsupported (only PathClassLoader and DelegateLastClassLoader are
supported).
- variable: if it changes over time, form one run to another.

In all the above cases the old compilation behavior is preserved for
now.(i.e. the dex file with be compiled with SKIP_SHARED_LIBRARY_CHECK)

Bug: 38138251
Test: runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/
adb shell cmd package compile -f -m quicken ^Csecondary-dex
com.google.android.gms

(cherry picked from commit 3bec94d78b0a66c4fa5cebd851ea33bcc51916b0)

Change-Id: Ie8b78c7c0d5de43733b3d116f8dcb3a65324cca8
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
535a4753e313bdc2ae3e8be9f50606b82edcce0c 04-Feb-2017 Calin Juravle <calin@google.com> Record dex files users in the dex-usage list

Add the users of the dex files in the package-dex-usage.list. This will
provide more data on why a package is marked as shared and not optimized
using profiles.

Test: runtest -x .../DexManagerTests.java
users of the dex files are recorded in package-dex-usage.list

Bug: 63778376
Change-Id: I329bc929b17fa0afe1531f3e6879f6160157a787
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
99dd37b3c5262910150ef955d16a33d32da264dd 23-Feb-2017 Calin Juravle <calin@google.com> Update package use info when the app data is updated

- clear usesByOtherApps flag when the package is updated
- delete secondary dex usage data when the app data is destroyed

Test: runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java
Bug: 32871170
Bug: 35381405

Change-Id: I3a249b9e8680e745fa678c7ce61b4ae764078fb9
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
b1097411028103b6c88ce325af23d2ff1ec746c8 27-Jan-2017 Calin Juravle <calin@google.com> Save package dex usage info after secondary dex reconciliation

Bug: 1833991
Test: add a bogus entry to /syste/data/package-dex-usage.list
adb shell cmd package reconcile-secondary-dex-files
com.android.google.gms
wait a bit and check the bogus entry is gone

Change-Id: Ic07126bfb8730933081a5e010e3c357d338786e8
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
51f521c3bf46e6040f36757bc53ea57ddc7be85e 26-Jan-2017 Calin Juravle <calin@google.com> Compile secondary dex files during background dexopt job

Extend the backgound dexopt job to compile secondary dex files when
"dalvik.vm.deopt.secondary" system property is set to true.

Test: adb shell cmd package bg-dexopt-job
Bug: 32871170
Change-Id: If3a4b77f785e92c7f2f7869e25ff9b99904f165a
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
1aa5f88e35734383e66ecd65e82e83d788e18ccb 25-Jan-2017 Calin Juravle <calin@google.com> [PM] Clean up logic for secondary dex oat files

Add logic in DexManager to reconcile secondary dex records with the
actual files on disk. If secondary dex files are moved or removed then
DexManager will remove the generated oat files during the call to
reconcileSecondaryOdex() and update its internal state.

Add 'adb shell cmd package reconcile-secondary-dex packageName' which
will force DexManager to sync its data with the actual secondary dex
files.

Test: devices bots
runtest -x .../PackageDexUsageTests.java
runtest -x .../DexManagerTests.java
adb shell cmd package reconcile-secondary-dex
com.android.google.gms (after artificially/temporarily renaming some
dex files)

Bug: 32871170

Change-Id: Id2d72dc89995f89cf1ddf79ae4e992afd3f3c127
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
0318162abcbd07a0472989df43e00e353fac731b 01-Dec-2016 Calin Juravle <calin@google.com> Add logic for recording dex files use on disk

Add PackageDexUsage to handle the I/O operations of dex usage data. It
is responsible to encode, save and load dex

Test: runtest -x .../PackageDexUsageTests.java

Bug: 32871170
Change-Id: I2acc5430080a7e937c798513d8959ab631decfd9
/frameworks/base/services/core/java/com/android/server/pm/dex/PackageDexUsage.java