History log of /frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f4eb8eb25c48de2f526c0400f2ddd0646b7d2f77 10-May-2017 Andreas Gampe <agampe@google.com> OtaDexoptService: Add missing return

Add early-return for null handling.

Bug: 38186355
Test: m
Test: manual OTA
Change-Id: I9076427ab0ddb97f2c81ff208947a0d172d1b650
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
37f190b346b899240656dece9ea57e45a34fe668 17-Apr-2017 Andreas Gampe <agampe@google.com> OtaDexopt: Add version support

Add version number to dexopt command. Current version is "2."

37256688
Test: m
Test: Manual OTA O (v2) -> O (v2)
Change-Id: I9fff673f3ba99833e88cf1c5c9625f42436ec150
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
3e1b6ad1e3eda378738d03e5861b344992e80f86 11-Apr-2017 Andreas Gampe <agampe@google.com> OtaDexOptService: Log post-reboot moves

Disable artifact checks for non-upgrade booting. Log the number of
successfully move artifacts.

(cherry picked from commit 95349c0e9664ec6392a959893f96390310e3b8a4)

Bug: 37158297
Test: m
Test: manual
Change-Id: Ic81531950582ce937e2e3b7815fb9132888d9a42
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
811a75a0c0dbe211ccabdfbfba60c8f76d5738eb 06-Apr-2017 Calin Juravle <calin@google.com> Pass SElinux info to installd dexopt

For secondary dex files, the oat directory is created on the fly. We
need to make sure we restore the SElinux context after the oat files are
generated. To do that we need to pass the app SElinux info to installd
dexopt.

Bug: 36896515
Test: adb shell cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms
adb shell ls
/data/user_de/0/com.google.android.gms/app_chimera/m/0000000c/oat/arm64/
-Z
youtube loads gms modules without extracting from apk

Change-Id: I5be34b42a509701f6222ca52bec4761c161ec6eb
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
30f18587e3bf6079f910699c89f1b702664982b5 24-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Drop REASON_CORE_APP.

After ensuring apps used by system server are speed compiled
on /system, we don't need a special reason anymore.

bug:36532541
bug:33799337

Test: m -j32 && boot
Change-Id: I1fb894f0f5b796cb9d59ed01a4afb2709c0f5496
(cherry picked from commit b70e4bfe0776a3446ccfddd5a10b1ff155f60e34)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
789a3e82cb204820c83b47d730744d91889af99b 18-Mar-2017 Andreas Gampe <agampe@google.com> Merge "Ota: Add command logging" am: 9a8d78dc86 am: 8dd991a7ef
am: c47f92b374

Change-Id: I6038dc9afd05c375bd1c6933b2aa5882f7835174
332dd12baa08a7663131042800ecb139520bb281 17-Mar-2017 Andreas Gampe <agampe@google.com> Ota: Add command logging

Log the next command.

Bug: 25612095
Test: m
Change-Id: I284a2fb3e329afcb0b03f7162585b0eefe13eb0e
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
c6494490939768ab86d88abd2e562e0e591d7a8e 02-Mar-2017 Calin Juravle <calin@google.com> Use DexManager logic to decide if a package is used by other apps

Stop relying on the file marker recorded by the runtime. We have the
same data available from the DexManager.

The clean up CL to remove the handling of the file markers will follow.

Test: verify that "shared packages" (e.g. gmscore) are not compiled with speed-profile.

Bug: 32871170

(cherry picked from commit 07b6eabe79261267ecd7114790e96e1f6828672a)

Change-Id: I2969b75fa77d38dde0073ef67aa89b1dc91237b5

Merged-In: I6cc5834ac88489e69896cd5fba9ed9968aa7f5a2
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
07b6eabe79261267ecd7114790e96e1f6828672a 02-Mar-2017 Calin Juravle <calin@google.com> Use DexManager logic to decide if a package is used by other apps

Stop relying on the file marker recorded by the runtime. We have the
same data available from the DexManager.

The clean up CL to remove the handling of the file markers will follow.

Test: verify that "shared packages" (e.g. gmscore) are not compiled with speed-profile.

Bug: 32871170
Change-Id: I6cc5834ac88489e69896cd5fba9ed9968aa7f5a2
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
d202a96073440c7d815a2de9f5136e0ef1e7e0e1 11-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge "Remove DEXOPT_OTA flag." am: 8584db972c am: 3dae5ca9d6 am: 91fca0f0ce
am: 4be6b800b4

Change-Id: I5adb5d7bc53d01e08675a5c05387546ae78763c9
c5b56942024a3211234cf35fed44e3e732143947 11-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge commit '7797e545239e81a9216994527badcc98178ebfcc' into dec10

Change-Id: I430a39241bd2d278eaf1e01b89be3ad368789f6d
4f05cd8900bfb559d5de58b86fa01f07bddafb2c 10-Dec-2016 Jeff Sharkey <jsharkey@android.com> Remove DEXOPT_OTA flag.

Test: builds, boots
Bug: 13758960, 30944031
Change-Id: I266a39c6dc7948f784580e4ef1cf0bb8ee27d0e7
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
740f523b2571d1c4eb4a954e1faedea45dd7fa53 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Final push of installd to Binder; goodbye socket!

Move last two straggling installd commands to Binder and destroy the
socket-based communication channel forever.

Test: builds, boots, apps install fine, pre-OTA dexopt works
Bug: 13758960, 30944031
Change-Id: I9afb9f71858febde34a94f53839b2986493b68a0
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
0d0bbd01e93fc716aa4c51bc5d0ad4c0889ccd1b 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge "Prepare to move dexopt calls to Binder." am: d7b144a5e9 am: 35cbe8ffb0 am: 41d75809aa
am: 67c8b01f4d

Change-Id: I1a746e34856b8fa1471ccacd3a8bde1d06866679
c98c7bccdccbff1ceeda501e6a6f8c21d61649ca 07-Dec-2016 Jeff Sharkey <jsharkey@android.com> Prepare to move dexopt calls to Binder.

Since InstallerConnection is about to be replaced by a new installd
Binder interface, this change moves OtaDexoptService to override and
manually cook up the 'dexopt' command line that it expects to collect
from PackageDexOptimizer.

Since OtaDexoptService is designed to be run in isolation, add a new
mode to Installer which ignores calls that aren't being intercepted.

Also moves to a single dexopt() method instead of having overloads.

Test: builds, boots, fake OTA works
Bug: 13758960, 30944031
Change-Id: I3a6a115289f1542d6df3e2993b9720118b7d1e8d
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
354736e196ff79962b3ddb52619a674044d773e2 23-Aug-2016 Dianne Hackborn <hackbod@google.com> New infrastructure to switch remaining commands to "cmd" calls.

This introduces a new feature of the IBinder command protocol
to allow the shell command implementation to call back into
its caller to ask it to open files in the calling context. This
is needed so that commands that have arguments specifying files
can open those files as the calling shell, not the system (or
whatever) process.

To test this all out, move the "am start" implementation over
to ActivityManagerShellCommand, in particular along with its
option to specify a file in which to write profiling data.

Test: Manual

Change-Id: I0c1e3857defefbd19a2ac29413aafbb34b1e48a3
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
13018f37305f94c9a091d8f7ef4e6bc7235de781 20-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Fix after-ota space measure

Actually measure the available space.

Bug: 31458900
Change-Id: I16ecee6c275229bc21e908b88b24152484025bc8
(cherry picked from commit 8d1d2ab5b94f011ed611259df387391f1a1fe60f)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
112e01480f62d42a0ce2527f7d98318cfec61b23 13-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexoptService: Add tron logging

Log key properties of A/B OTA dexopting.

Bug: 31458900
Change-Id: Iba1e5a40ff8b4998d4d876800ee59940f01afb6e
(cherry picked from commit 77cc8172d31fff398b81a039b3fddc8acd1c609b)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
1920d7b434ea7424cae8249adec56856fb2484ae 10-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Downgrade apps when low on space

When running low on space, attempt to "downgrade" apps to lower
states in the optimization flow to free up space before starting
the OTA.

Bug: 31347757
Change-Id: I3a44b106b83d86d7290f4c557267b319f28de12a
(cherry picked from commit dab38e000436bf8234955b0333eaecf389e65b6f)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
8d1d2ab5b94f011ed611259df387391f1a1fe60f 20-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Fix after-ota space measure

Actually measure the available space.

Bug: 31458900
Change-Id: I16ecee6c275229bc21e908b88b24152484025bc8
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
77cc8172d31fff398b81a039b3fddc8acd1c609b 13-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexoptService: Add tron logging

Log key properties of A/B OTA dexopting.

Bug: 31458900
Change-Id: Iba1e5a40ff8b4998d4d876800ee59940f01afb6e
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
dab38e000436bf8234955b0333eaecf389e65b6f 10-Sep-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Downgrade apps when low on space

When running low on space, attempt to "downgrade" apps to lower
states in the optimization flow to free up space before starting
the OTA.

Bug: 31347757
Change-Id: I3a44b106b83d86d7290f4c557267b319f28de12a
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
94f9be2ee2a40b390cc4de1f24a33d0b662a2d79 18-Aug-2016 Todd Kennedy <toddke@google.com> Release mPackages lock earlier

We cannot hold mPackages when calling into generatePackageDexopts().
This method takes Package Manager's mInstallLock. By holding mPackages,
we have lock inversion and hilarity ensues.

Change-Id: Ia11a158677051e3511702f38cde6780e75b256fb
Fixes: 30927731
(cherry picked from commit a8d4f489974f3ea8f73990cbabbce205343fb926)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
3f95d0bb6af6a155291cff3f6b61b2b25348127f 02-Aug-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Special-case system app classpaths

Specialize system apps' shared libraries so that classpath checks
are elided.

Bug: 30568568
Change-Id: Id1f2555ef43984b616e01f8596701ccba77895b3
(cherry picked from commit c7e02c1d2a53e0f738d2a8383e03658b39d91ce6)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
14186731f98d326239922d093371d1e63b8c22a5 29-Jul-2016 Andreas Gampe <agampe@google.com> OtaDexoptService: Run dexopt on all apps

To avoid work after reboot, dexopt all apps. However, unimportant
apps are optimized with the first-boot reason (which is usually
interpret-only) for space reasons.

Bug: 30468718
Change-Id: Ia05d879957388967c69f9380e50d8a9834afe07d
(cherry picked from commit 115514b236ebe7cb3c90892891954b8c7ba69335)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
7e619a912cf6a53ede7d7eea67f8bc8ed1158e24 13-Jul-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Add compiler stats to Package Manager

Add a simple class for storing compiler statistics. Capture compile
times for code paths from a package.

Bug: 29223204
Change-Id: I1b066de6a83a739470a42480eee0bfef88423eea
(cherry picked from commit 37e5fdc6b4963f3533caecdd92b129f79da69dd8)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
9438528d99a404ce10e567bbbb5f0cc9519fb5da 12-Jul-2016 Calin Juravle <calin@google.com> Compile core-apps according to their own "reason" for A/B

If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not
speed (by default is speed-profile) they will be interepreted/JITed.
This in itself is not a problem as we will end up doing profile guided
compilation. However, some core apps may be loaded by system server
which doesn't JIT and we need to make sure we don't interpret-only.

Bug: 30032273
Change-Id: Idb11b1c01c4c4ceba043feb3a9ccc6958035d3b7
(cherry picked from commit 565621328dd4fc2e179a34494d0f8b8dc1b1eae9)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
d15300cf38ae3840309dc6cb6c093b17713fc277 24-Jun-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Add new flow to OtaDexoptService

Add functionality to capture/intercept installd communication, and
use this to return the full communication for dexopt. These parameters
can be used to drive otapreopt_chroot directly.

Keep the old direct invocation alive until devices have transitioned
to a service that exposes this API.

In preparation for renaming of A/B OTA artifacts to include target
slot names.

Bug: 25612095
Bug: 28069686
Change-Id: I14728ee1266f3882cada8f08dd21891ed5f7a0cb
(cherry picked from commit cc241a580cb9b753d0dde0cea578feb74ad517e7)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
ff8ab4c9fade0dd95bac6df6506e1ce14dbd8e42 11-Jun-2016 Andreas Gampe <agampe@google.com> Otadexopt: Expose progress percentage

To be able to report progress of an A/B OTA dexopt, expose a
progress function that the script can query.

Bug: 25612095
Bug: 29223204
Change-Id: Ie8162946d18f6fa78649a40ad5d3949d31a181cd
(cherry picked from commit bf06232f4d440ced8230662a77ca0e8ece6383ca)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
a8d4f489974f3ea8f73990cbabbce205343fb926 18-Aug-2016 Todd Kennedy <toddke@google.com> Release mPackages lock earlier

We cannot hold mPackages when calling into generatePackageDexopts().
This method takes Package Manager's mInstallLock. By holding mPackages,
we have lock inversion and hilarity ensues.

Change-Id: Ia11a158677051e3511702f38cde6780e75b256fb
Fixes: 30927731
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
c7e02c1d2a53e0f738d2a8383e03658b39d91ce6 02-Aug-2016 Andreas Gampe <agampe@google.com> OtaDexopt: Special-case system app classpaths

Specialize system apps' shared libraries so that classpath checks
are elided.

Bug: 30568568
Change-Id: Id1f2555ef43984b616e01f8596701ccba77895b3
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
115514b236ebe7cb3c90892891954b8c7ba69335 29-Jul-2016 Andreas Gampe <agampe@google.com> OtaDexoptService: Run dexopt on all apps

To avoid work after reboot, dexopt all apps. However, unimportant
apps are optimized with the first-boot reason (which is usually
interpret-only) for space reasons.

Bug: 30468718
Change-Id: Ia05d879957388967c69f9380e50d8a9834afe07d
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
37e5fdc6b4963f3533caecdd92b129f79da69dd8 13-Jul-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Add compiler stats to Package Manager

Add a simple class for storing compiler statistics. Capture compile
times for code paths from a package.

Bug: 29223204
Change-Id: I1b066de6a83a739470a42480eee0bfef88423eea
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
565621328dd4fc2e179a34494d0f8b8dc1b1eae9 12-Jul-2016 Calin Juravle <calin@google.com> Compile core-apps according to their own "reason" for A/B

If the core apps are not preopted in the B OTA, and REASON_AB_OTA is not
speed (by default is speed-profile) they will be interepreted/JITed.
This in itself is not a problem as we will end up doing profile guided
compilation. However, some core apps may be loaded by system server
which doesn't JIT and we need to make sure we don't interpret-only.

Bug: 30032273
Change-Id: Idb11b1c01c4c4ceba043feb3a9ccc6958035d3b7
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
cc241a580cb9b753d0dde0cea578feb74ad517e7 24-Jun-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Add new flow to OtaDexoptService

Add functionality to capture/intercept installd communication, and
use this to return the full communication for dexopt. These parameters
can be used to drive otapreopt_chroot directly.

Keep the old direct invocation alive until devices have transitioned
to a service that exposes this API.

In preparation for renaming of A/B OTA artifacts to include target
slot names.

Bug: 25612095
Bug: 28069686
Change-Id: I14728ee1266f3882cada8f08dd21891ed5f7a0cb
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
bf06232f4d440ced8230662a77ca0e8ece6383ca 11-Jun-2016 Andreas Gampe <agampe@google.com> Otadexopt: Expose progress percentage

To be able to report progress of an A/B OTA dexopt, expose a
progress function that the script can query.

Bug: 25612095
Bug: 29223204
Change-Id: Ie8162946d18f6fa78649a40ad5d3949d31a181cd
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
bd784e961c560a2069e2df75fb17282013c198d2 28-Apr-2016 Jeff Hao <jeffhao@google.com> Some cleanup for <uses-library> change.

Addresses comments made in:
https://googleplex-android-review.git.corp.google.com/#/c/976512

Bug: 26880306
Change-Id: I382fb39f3bb5de5a03506f5526d909cf55530542
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
c7b9482b0c4bb2d378e63541b96be45c50094e05 16-Mar-2016 Jeff Hao <jeffhao@google.com> Support to pass <uses-library> option through to dex2oat.

This change takes an app's shared libraries specified by <uses-library>
and passes it through to dex2oat to be used during compilation.

Part of a multi-project change.

Bug: 26880306

(cherry-picked from 7b331b6a8ae8d9f10482b292439457de98abd32a)

Change-Id: I523b1b74775e7ed27072498509e743f1f10b1164
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
43fc2447df2354fcb7b843a86b1c266946ca5702 25-Mar-2016 Andreas Gampe <agampe@google.com> PackageManager: Move compilation reasons to PMS

Move the reasons to PackageManagerService (making them public) so
they can be used by clients.

Bug: 27189430
Change-Id: I30e1f823f9297e95c5b1e389004a4fd3052d5702
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
bdd30d86ef98456161069d11481b2ccd25a11b4e 20-Mar-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Refactor package manager

Introduce a mapping between dexopt reasons and compiler filters. Use
reasons in package manager and other classes, where possible.

Change PackageDexOptimizer to accept a compilation filter. Adapt for
the split-out profile merging. Pass compilation filter to installd.

Bug: 27689078
Change-Id: I8c0ea6f10fbfdbd096adecc52abfd2466d048fdc
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
abcbe2f62e6278d8aeb0b8c302d23aeae59899d4 26-Feb-2016 Andreas Gampe <agampe@google.com> Frameworks/base: OtaDexopt needs to move artifacts on boot

Make OtaDexoptService a bootstrap service. It needs to start
immediately after the PackageManagerService so that it can move
A/B artifacts into their new place.

Add a method to Installer for the move.

Bug: 25612095
Change-Id: Idcf759b3c947088b416d54d2fa269ef27daf93ab
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
693f997cc8b8c2ba8d3ed29627b2641dd86392a5 25-Feb-2016 Calin Juravle <calin@google.com> Better handling of various types of compilation in DexOptimizer

From the runtime perspective extract-only/profile-guide-compiled/fully-
compiled oat files are up-to-date and don't need dex2oat. However,
wihout knowing the exact "class" of the aot file we are not able to do a
full compilation of something previously only-extracted, or limit
profile-guide compilation to only previously profile-guide or extract-
only oat files.

GetDexOptNeeded now accepts a mask of desired types of compilation
that the runtime takes into account when advising what's needed.

This CL adds the necessary handling in DexOptimizer.

Also:
- removes the contraint to use extract-only oat files only when
profiles are enabled.
- removes mDexOptPerformed which interfere with the different types of
compilation and only saved a call to GetDexOptNeeded.

Bug: 27189430
Change-Id: Iced2bdcc3aa7866ff888a3bace43f4b71fffb353
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
6b4736d604fd91aaedc6f3fe9be5a1e757aab86c 04-Feb-2016 David Brazdil <dbrazdil@google.com> Apply 'used in last 7 days' filter to OTA package extraction

Bug: 26813999

Change-Id: I5f1eddb1d5e9f0bbaab62d86e6ccf3cc097c4edb
(cherry picked from commit e292175fbd495a63b48560439d2a84b239f91e18)
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java
a89087542f774c585b6a6ec535fc294721710521 10-Nov-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Add A/B OTA preopting

Add an OTA Dexopt service. Refactor package manager service and
package dex optimizer to reuse some code. Add knowledge about
OTA flag to installer.

Bug: 25612095
Change-Id: I7dd6bb468fea44b9d3acf0ac7d7404fb02d0f30a
/frameworks/base/services/core/java/com/android/server/pm/OtaDexoptService.java