History log of /frameworks/native/cmds/installd/dexopt.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
76689e9b20ff5d377fb33eaa23edcad9300d5fc4 05-Jun-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Disable in-place vdex update"

Reverting to only apply this when doing dexlayout.
PS1 is a pure revert. PS2 contains the fix.

This reverts commit e446fede9258359b61d4c8753d7e96477fa29388.

Bug: 38113240
Test: OTA and dexopt

(cherry picked from commit b03814f39559c824e097bf2d869c7a56d8b41b67)

Change-Id: Ibabb1ec3af1101c6c44fbea498f8625c9515af8f
/frameworks/native/cmds/installd/dexopt.cpp
3291cd9eaab89538dac3af66a5f099da7d320c86 27-May-2017 David Sehr <sehr@google.com> Disable in-place vdex update

Vdex files can be corrupted by dexlayout or by previously dexlayout-ed
files being recompiled if they are used as both input and output.
Disable this feature.

Bug: 38113240
Test: OTA and dexopt
Change-Id: Iee2d9a6c1ba8cddda25290f68f50649d5288d588
(cherry picked from commit e446fede9258359b61d4c8753d7e96477fa29388)
/frameworks/native/cmds/installd/dexopt.cpp
3040d9db984237259c0ec7238ad9081018ffe808 25-May-2017 Nicolas Geoffray <ngeoffray@google.com> Delete vdex file in delete_odex.

(cherry picked from commit 192fb9662ce8b2a60da2b280d8000283fb3b6f6b)

bug: 38513395
Test: unfortunately no unit test here, so after discussing
with agampe@ just relied on build.

Change-Id: I305ddaadc813673fb55473f5e8ca357f39cf98f3
/frameworks/native/cmds/installd/dexopt.cpp
74a812c587c21e85449a47c098c57d87c1527306 19-May-2017 Calin Juravle <calin@google.com> Merge "Delete secondary dex profiles during reconciliation" into oc-dev
513140941eeec7a5bad56956cce101f3da829d43 19-May-2017 Calin Juravle <calin@google.com> Delete secondary dex profiles during reconciliation

Test: manual inspections after adb shell dumpsys package dexopt
Bug: 38430319
Change-Id: I8401288b753a0c38ee3020d12e8e02c4a25723d2
/frameworks/native/cmds/installd/dexopt.cpp
89726a1deaca6646e1641e0358186a0a19374dc7 11-May-2017 Nicolas Geoffray <ngeoffray@google.com> Merge "Handle safe mode in PackageManager." into oc-dev
a0af34de9ef2449000343b468f4a056a91dcdbb6 03-May-2017 Nicolas Geoffray <ngeoffray@google.com> Handle safe mode in PackageManager.

installd side of the change.

bug:37929796
Test: manual OTA with a safemode app.

(cherry picked from commit be6ecd6f6141de1ecd4ec6eb5885bdd0f655fafa)

Change-Id: I43dcdd3fea3f62398f16f89348c1a2f1b4b1bb6d
/frameworks/native/cmds/installd/dexopt.cpp
105e98780cfcf3145d6c53c57a41e924eb73bb05 09-May-2017 Nicolas Geoffray <ngeoffray@google.com> Always unlink the out_vdex_file.

Even if we pass the same vdex file as input and output to
dex2oat, make sure we unlink it if dex2oat failed.

bug:38113240
Test: manual, killing dex2oat invocation

(cherry picked from commit 7bb165779f59bfa1324ca991f64ab98331a410b5)

Change-Id: I157b3d33179b5bff1ca38750bee24aab01c5a19b
/frameworks/native/cmds/installd/dexopt.cpp
9014ca88a9412cb1a1168ae842f30f8783ea1e3d 03-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Disable input-vdex when doing speed-profile."" into oc-dev
575fc2c3c8f67be2a258cf28f915c7c902f332d1 24-Apr-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Disable input-vdex when doing speed-profile."

https://android-review.googlesource.com/#/c/377754/ is fixing vdex and delayout.

bug: 37558732
Test: device boots, vdex works on OTA, input-vdex is passed
for speed-profile

This reverts commit a2dbefc7a51482acb8d5d139c9e2f01306ef9ceb.

(cherry picked from commit 3c95f2da655567d9fcc28d7a35dcc79d75cb61f6)

Change-Id: I4d36ec79ca681e20ffb181ec099ce5b229e38aed
/frameworks/native/cmds/installd/dexopt.cpp
63d8e566f7396884de830a0af358f0ad2c11f302 25-Apr-2017 Nicolas Geoffray <ngeoffray@google.com> Update installd to new compiler filters.

bug:34715556
Test: build and boot aosp bullhead

(cherry picked from commit 4b64ed991b23dc1215ce10fce69c3e2595dd34b7)

Change-Id: Ib94bda97ed131878c3be092d58920500d2d8d556
/frameworks/native/cmds/installd/dexopt.cpp
10b8a6e72c5b1c2eef4e5657dd0927f0c1623fff 06-Apr-2017 Jeff Hao <jeffhao@google.com> Run dex2oat from the staged apk directory.

The frameworks/base change makes the PackageManager pass relative paths
of previous code paths as shared library paths. This change passes the
base directory for these relative paths to dex2oat using the new switch
--classpath-dir.

Part of a multi-project change.

Bug: 34169257
Test: cts-tradefed run singleCommand cts -d --module
CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests

(cherry-picked from commit cc5c4e32637601432bc6359fb7ff34e4cadb6502)

Change-Id: I8f941eb9982a051c1f49256d5489f2575af1d80f
/frameworks/native/cmds/installd/dexopt.cpp
c4ced4f015ef5ba66cc89440c89369190448a4e0 15-Apr-2017 Andreas Gampe <agampe@google.com> OtaPreopt: Add version support

Add versioning to otapreopt:

Give up on having otapreopt being a mostly-ignorant frontend to a
blackbox dexopt function. Remove the dexopt helper taking a char*[], and
replace with a direct call to the typed signature.

Add support for a versioned dexopt command. The current version is
"2." An unversioned command string is either version "1" (N) or
version "2" (O pre-versioning).

Translate version 1 to version 2 by
* filter DEXOPT_OTA
* override dexopt_needed to DEX2OAT_FROM_SCRATCH
* add null se_info

Bug: 37256688
Test: m
Test: Manual OTA N (v1) -> O (v2)
Test: Manual OTA O (pre-versioning) -> O (v2)
Test: Manual OTA O (v2) -> O (v2)
Change-Id: I9fff673f3ba99833e88cf1c5c9625f42436ec150
/frameworks/native/cmds/installd/dexopt.cpp
cb556e340b50d16e8fac41b0c69d8d35bd7915f9 05-Apr-2017 Calin Juravle <calin@google.com> Restore selinux labels for secondary dex oat directory

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: I4e12a6f532a1442a840e3ed8d01b98dd9a328eb6
/frameworks/native/cmds/installd/dexopt.cpp
ebc8a79bbc00759307bed9142b60cff1e35d79e0 05-Apr-2017 Calin Juravle <calin@google.com> Fix permission for public secondary dex files

- make the oat directory accessible by others
- if the dex files is readable by others and we are not doing a speed-
profile compilation make the oat file readable by others.

Bug: 36896515
Test: adb shell cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms
check that the oat directory and files have the right permissions

Change-Id: I1829217004353fb8c86e5a6b7eb570555e36a495
/frameworks/native/cmds/installd/dexopt.cpp
013f02e58b0b17b5b9fb4b4a2b3dc482eecfc434 21-Mar-2017 Andreas Gampe <agampe@google.com> Installd: Clean up installd

Remove unnecessary includes.

Bug: 36336122
Test: m
Test: Device boots
Test: Can install apps
Change-Id: Iebbe049221d650667385efeac972956269bd53c2
/frameworks/native/cmds/installd/dexopt.cpp
114f08107be384a3f9cc954bdec2b6b7619354ae 09-Mar-2017 Calin Juravle <calin@google.com> Support profile guided compilation for secondary dex files

Test: adb shell cmd package bg-dexopt-job works for sercondary dex files
Bug: 26719109
Change-Id: I4011a780f65378c23a4631c07c37cdb4f5fee41e
/frameworks/native/cmds/installd/dexopt.cpp
4eba6d702e7ca40875d7e2d30129672a43d9a28b 15-Mar-2017 Calin Juravle <calin@google.com> Use assignment instead of reset for profile unique_fd

Using reset with a unique_fd will just convert the unique_fd to int
without releasing it.

Test: adb shell cmd package compile -m speed-profile com.google.android.googlequicksearchbox
Bug: 36234017
Change-Id: I577197ac4a147765191777a5ebc6ef150dea1027
/frameworks/native/cmds/installd/dexopt.cpp
1a0af3b982b851519b06233addaa9c3bcb61f627 09-Mar-2017 Calin Juravle <calin@google.com> Use unique_fd instead of fd_t when managing profiles

Long due code improvement...

This will make things cleaner when adding support for secondary dex
profiles.

Test: adb shell cmd package bg-dexopt-job
Bug: 26719109
Change-Id: I232759d76c285c9eed9885f8ee4b84431fd65d15
/frameworks/native/cmds/installd/dexopt.cpp
76268c56febde9a77183387fbd4baabe6694e6b5 09-Mar-2017 Calin Juravle <calin@google.com> Use std::string for profile operations instead of const char

Will make things cleaner when adding secondary dex profile support.

Also, add tests to verify profile path creation.

Bug: 26719109
Test: /data/nativetest64/installd_utils_test/installd_utils_test
Change-Id: I8cb1a11cefee21f5001d2b729110696d52fc8323
/frameworks/native/cmds/installd/dexopt.cpp
a2dbefc7a51482acb8d5d139c9e2f01306ef9ceb 09-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Disable input-vdex when doing speed-profile.

input-vdex and dexlayout are incompatible with each other.

bug: 36084905
bug: 36076104
bug: 36059948
bug: 35872504

Test: device boots, vdex works on OTA, input-vdex is not passed
for speed-profile.

Change-Id: I194311041899399db422867670f5e788d6b9ceeb
/frameworks/native/cmds/installd/dexopt.cpp
2289c0ac89acce109b3e93c434d86b20c5ecc1ad 15-Feb-2017 Calin Juravle <calin@google.com> Fix the ownership of compiler artifacts for secondary dex files

odex, vdex and art files should be owned by the app and not by system.

Test: verify odex and vdex owner:
adb shell cmd package compile -m speed --secondary-dex -f
com.google.android.gms
adb shell ls
/data/user/0/com.google.android.gms/app_chimera/m/00000004/oat/arm64/
-al
-rw-r--r-- 1 u0_a17 u0_a17 5640832 2017-02-02 18:00
DynamiteModulesA_GmsCore_prodmnc_alldpi_release.odex
-rw-r--r-- 1 u0_a17 u0_a17 3016818 2017-02-15 12:42
DynamiteModulesA_GmsCore_prodmnc_alldpi_release.vdex

Bug: 35389574
Bug: 32871170

(cherry picked from commit 944d0def1a628bcbd76056683085efd2b999fe5b)

Change-Id: I1f0d09d04807b6284d42f0cf89956322a4214d5f

Merged-In: I0650265cedcc572d43bb1fc0d0758ae43ea890b2
/frameworks/native/cmds/installd/dexopt.cpp
2ab108c5be96768ef094591720596fbc4b7f91f7 31-Jan-2017 Calin Juravle <calin@google.com> DEXOPT_FORCE may be passed for primary apk as well.

Remove the check that DEXOPT_FORCE is not set for primary apks. PM will
set it when forcing compilation.

Bug: 32871170
Test: adb shell cmd package compile -f m speed pkgname

(cherry picked from commit 259702336f5826d2a205a2b038cb5a3263fb10e9)

Change-Id: Id34cd1ec929a1e196caf61651a18eb9c275b2590

Merged-In: I690608c48a2c486230ca7d2328ac5c6181427328
/frameworks/native/cmds/installd/dexopt.cpp
c9eab382fa4d71ade0077e0547969a47f39ecf05 25-Jan-2017 Calin Juravle <calin@google.com> [Installd] Clean up logic for secondary dex oat files

Add a new method to installd, reconcileSecondaryOdex, which checks if
the given dex files still exist and if not, deletes the oat files that
were generated for it.

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

Bug: 32871170

(cherry picked from commit bd9683607d391a29b1422a50f8972267e9bddc47)

Change-Id: Icb5c71b43a0e531d5be5d900149e707d0fe0a8de

Merged-In: I8465a7be9fd4e44e191ad40f7bd0f41c8b2d6f73
/frameworks/native/cmds/installd/dexopt.cpp
80a2125b85eaa0916daea7e90b016fe4f1b59924 17-Jan-2017 Calin Juravle <calin@google.com> Add installd logic for compiling secondary dex files

Secondary dex compilation takes almost the same path as primary apk
compilation.

The main difference is in the fact that for secondary dex files we
create the oat dir on the fly and execute dexoptanalyzer (the equivalent
of GetDexOptNeeded) to check if we really need to perform the
compilation.

Test: adb shell cmd package compile -f -m speed --secondary-dex com.google.android.gms
Bug: 32871170

(cherry picked from commit 42451c029b0e87990e5833daea2286bb12c21df5)

Change-Id: Ie5efe6eccc6b8c91ca7bd7c9e680aa7288d79ae8

Merged-In: I2c56d57322899968a338ccabffca575d66f8ee08
/frameworks/native/cmds/installd/dexopt.cpp
3ef54f28c2143170e172fc12f0e9e6bde15ea4d3 25-Jan-2017 George Burgess IV <gbiv@google.com> Add permission bits to open calls with O_CREAT

Open needs a third argument if you pass it O_CREAT:
https://linux.die.net/man/3/open

This turns into a compile-time error with FORITFY, so we need this fixed
before our unbroken FORTIFY can go in.

(The TEMP_FAILURE_RETRY open isn't detected by clang FORTIFY, but I
noticed that open_reference_profile potentially passes in O_CREAT as an
open_flag.)

Bug: 32073964
Test: Now builds with clang FORTIFY; CtsCompilationTestCases passes;
manually verified that /data/misc/profiles/ref/*/primary.prof has rw
permissions after a successful `cmd package compile -m speed-profile`.
Change-Id: Ie707d5ad403d2f86c769277b3e0f147c45000a6b
/frameworks/native/cmds/installd/dexopt.cpp
36cebe7778a89fa1302a8828ade93db2d014c522 25-Jan-2017 George Burgess IV <gbiv@google.com> Replace strlen with arraysize in array bounds.

clang-FORTIFY doesn't let us evaluate strlen("foo") as a constant
expression that can be used in static array bounds. Instead, we'd need
to either do __builtin_strlen("foo") or arraysize("foo") - 1. Just use
arraysize here, since the extra 1 byte per array isn't likely to be a
terrible thing.

Happy to swap to __builtin_strlen if anyone cares deeply enough.

Bug: 32073964
Test: Now builds with clang FORTIFY.
Change-Id: I4c9b3eb74775901554b939246722bd3a22326d10
/frameworks/native/cmds/installd/dexopt.cpp
7a570e8a0091a93be7dfd98acbb693bbb6ace75a 15-Jan-2017 Calin Juravle <calin@google.com> Clean up and simplify the logic in dexopt

Make some order in dexopt logic by extracting independent parts in their
own helpers.

It will make further updates of dexopt simpler and easier to reason
about (e.g. for secondary dex files).

Test: device boots
adb shell cmd package compile -m speed|speed-profile packageName
install new packages

Bug: 32871170

(cherry picked from commit 4a391f80601d7f65d7e63353363e6d32868161d5)

Change-Id: If0c96174e904519a4332e54553690b691ff63149
/frameworks/native/cmds/installd/dexopt.cpp
7823e124e00576e20e47ec717cbe8bc89f0f2bf2 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if possible
- add system includes that are assumed as side effects
- define LOG_TAG first

Test: compile
Bug: 31289077
Bug: 30465923
Change-Id: I8d99b24c333578c9b5aa9f2a01324bd0bba268dd
/frameworks/native/cmds/installd/dexopt.cpp
76cc027ca6ebfd2f870c1cbb8f1d1fd19e0ac8e9 08-Dec-2016 Richard Uhler <ruhler@google.com> Cleanup code given PATCHOAT_FOR_RELOCATION has been removed.

Test: make, device boots.
Bug: 33192586
Change-Id: Ic3937708a7dfcd16f02cf68fc20674ec457d60b7
/frameworks/native/cmds/installd/dexopt.cpp
4f8c1fd2ea233a343f05302221cb87d29fe06224 05-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Pass the same fd when compiling due to boot image update."
ca12228bc2a27b1cd01b820d01b2ef17622cc730 20-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Pass the same fd when compiling due to boot image update.

Test: device boots, apps get installed, OTA uses same vdex.
Change-Id: I913062630640f31a18d23b2f62afd74986322e6a
/frameworks/native/cmds/installd/dexopt.cpp
a5e161b1207ef447a51e99856097d69d4a6111e1 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if required
- add system includes that are assumed as side effects of log.h
- modules that use SLOG should use SLOG for all logging (installd)
- define LOG_TAG first
- remove logging infrastructure if not used

Test: build
Bug: 31289077
Change-Id: Iea147a0104c7ab7f12451304131d6500f42141e7
/frameworks/native/cmds/installd/dexopt.cpp
90aff26f0135379db19432ae90c40c0831ba5954 12-Dec-2016 Jeff Sharkey <jsharkey@android.com> Split all dexopt-related code into dexopt.cpp.

Only a few minor changes to return bool instead of binder::Status.

Test: builds, boots, apps install/uninstall fine
Change-Id: I538024c0e9da8ca2c0983a6e779c34bd40752053
/frameworks/native/cmds/installd/dexopt.cpp
6c2c056193010cf93b4264810d462c120ce801c8 07-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: I2ecd604fb6627b9028a7e32f87d0367e4a4afde3
/frameworks/native/cmds/installd/dexopt.cpp