History log of /frameworks/native/cmds/installd/commands.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
40e566de4b17a0f5f200fbf5014d30367c1992fa 02-Jun-2016 David Sehr <sehr@google.com> Enable profman pretty printing

Bug: 28748264
Change-Id: Ia625a7976d9b95ec3b7e1d03af39af9f39015f3b
/frameworks/native/cmds/installd/commands.cpp
d25aab3ce8aab1b95ac60922981c87c6963a0a6b 02-Jun-2016 Calin Juravle <calin@google.com> Merge "Create primary profile file together with app data folders" into nyc-dev
6727c2d0bfc876c62d6ee60d8a05d26bef1d56ef 18-May-2016 David Sehr <sehr@google.com> installd support for profman --dump-info-for

Bug: 28748264
Change-Id: Idcd3ed86294c1d0c75c26ca938b88744a25e387a
/frameworks/native/cmds/installd/commands.cpp
bc56e7dcf07e633867e1525435373a1231216b22 24-May-2016 Calin Juravle <calin@google.com> Create primary profile file together with app data folders

Bug: 28785119
Bug: 28625993
Change-Id: I12c0de85bc3dc35199acf32c10fe69f93e76d7fc
/frameworks/native/cmds/installd/commands.cpp
51c94495be151c1da03c8266592ed33f253d4b48 11-May-2016 Jeff Sharkey <jsharkey@android.com> Move both CE/DE storage areas to adopted storage.

Public APIs now support separate CE/DE storage areas on all devices,
so they both need to be moved together.

Bug: 25861755
Change-Id: Ibe64a0c9ce0ef286adff2b66bfd432d14f1041d0
/frameworks/native/cmds/installd/commands.cpp
54e292e1ea87b504b552393d2e9bc800458bd0c1 11-May-2016 Jeff Sharkey <jsharkey@android.com> Search both CE/DE storage when clearing caches.

Now that we have two data storage locations, we need to scan them
both when freeing up disk space. Clean up logic to use new
get_known_users() API.

Bug: 26056125
Change-Id: Ic05c0022d6f5eb438967b69402b1900678f3858b
/frameworks/native/cmds/installd/commands.cpp
2e063af1651976b50e2da58c4d57564d878ab9c2 02-May-2016 Narayan Kamath <narayan@google.com> installd: remove spammy warning for non-existent profile dirs.

Also gets rid of a lstat call which seems unnecessary. We can
directly open the directory and fail if the open fails.

bug: 28510519
Change-Id: Iaf2b7e69d51e2670e62cbe2807874c9b0dd471e5
/frameworks/native/cmds/installd/commands.cpp
b63d91fd2737680351876406277b6c759f4db33c 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.

Includes fix from c09662d9bbd35840b24cae8d336a0d11c0cbdb7b

Bug: 26880306

(cherry-picked from commmit de7f0cf8a699f6f7a7d29b4a14d800bea9abbef4)

Change-Id: Ideb2aba46f4cf52acb9dd480993513a60dbfd6ce
/frameworks/native/cmds/installd/commands.cpp
379a12b0072b322c7f86e690a8e8a220e500861c 15-Apr-2016 Jeff Sharkey <jsharkey@android.com> Consistent creation/destruction of user data.

Preparing and destroying users currently needs to be split across
installd, system_server, and vold, since no single party has all the
required SELinux permissions.

Start passing down flags so we only prepare/destroy storage areas
that have keys currently installed.

Add delete_dir_contents_and_dir() argument to ignore ENOENT, since
all we care about is the directory being gone.

Bug: 27896918
Change-Id: Ia1cccc9b35e6ff09e3ca50effeab676157b856e8
/frameworks/native/cmds/installd/commands.cpp
2f720f7ec5c9d0b91defc85878e7330b10f8e89a 11-Apr-2016 Jeff Sharkey <jsharkey@android.com> Use inode numbers for CE storage, fix sizes.

Certain operations, such as clearing/destroying app data, or just
counting on-disk size, require us to know the CE storage directory
of a particular app. To facilitate these operations, offer a method
to get the inode of a CE directory, and accept that inode number
for later operations.

In previous releases, we started installing apps using a new
directory-based layout, where all app code, unpacked native libraries,
and optimized code is bundled together. So now we only have a single
path to measure for code size.

Start measuring both CE and DE storage data usage for apps, and tweak
the reporting so that empty cache/data directories actually show up
as "0 bytes".

Fix bugs in disk usage counting, since st_blksize has no bearing on
the allocated disk space. Also don't double-count "." and ".."
directories when measuring storage.

Bug: 27828915, 27197819
Change-Id: I350b951f5c24165edb253ac663c9aae020c24dc9
/frameworks/native/cmds/installd/commands.cpp
5006f3a6bcfbe73cfae96b3f2659ce42e18bc2ea 07-Apr-2016 Narayan Kamath <narayan@google.com> installd: log failed unlinks.

bug: 28054110
Change-Id: Id46aacba293c81bb3bb6a0b9721b9b4fe11ed652
/frameworks/native/cmds/installd/commands.cpp
64b59cc1c89225813295d1b5d6bf4183615da204 05-Apr-2016 Roland Levillain <rpl@google.com> Close profile before leaving android::installd::clear_profile.

The profile file descriptor used to be kept open and to
produce SElinux denials when installd ran dex2oat, as that
file descriptor was passed accross security domains.

Bug: 27943553
Change-Id: Ie025082f97c2736156bd5069d7a22aacde86f039
/frameworks/native/cmds/installd/commands.cpp
a812bcfd06df38a360545ae6655a90a9564c3aa9 30-Mar-2016 Mathieu Chartier <mathieuc@google.com> Revert "Avoid unlinking app image file"

Need unlink or the image file can change while being mmaped.

Bug: 27493510

This reverts commit 310c5e70b2e36df36811b6de7ad5c2ebd82338e5.

Change-Id: Ied09848e0b646f946f20f2ed114cac6b438bcda1
/frameworks/native/cmds/installd/commands.cpp
7535e8e1995398befc866062d63c05d90eb70ccc 29-Mar-2016 Calin Juravle <calin@google.com> Destroy the reference profile during uninstalls

Bug: 27896463
Change-Id: I6b182e2c3276f6228a2ed70ee2c6f0c49c638760
/frameworks/native/cmds/installd/commands.cpp
cea31418f34680fcfea4ec885dc966ad3d76354f 29-Mar-2016 Calin Juravle <calin@google.com> Do not unlink the profiles if not needed

It's enough to just clear the profiles. The app might still run and we
will see misleading warning or we might miss recording profile
information.

Bug: 27895342
Change-Id: I04961f09e0965a3e4af87acb95a7c74773f7a44a
/frameworks/native/cmds/installd/commands.cpp
b06f98aabc5381fd6366526d9b31b5d0345481b6 28-Mar-2016 Calin Juravle <calin@google.com> Don't report errors when trying to delete a non-existing profile dir

Also, put destroy_app_current_profiles behind FLAG_STORAGE_DE flag.

Bug: 27081617
Change-Id: Ib8b9ff292784c659259ceb4339b803e3580da7ed
/frameworks/native/cmds/installd/commands.cpp
d1a6a2495ff82893728571136f4f080164c8dae5 25-Mar-2016 Calin Juravle <calin@google.com> Merge "Do not clean profiles unconditonally during app data clean up" into nyc-dev
edae669f18eb99b9316891fdde627e2f385c3c64 23-Mar-2016 Calin Juravle <calin@google.com> Do not clean profiles unconditonally during app data clean up

The goal is to enable profiles to be persisted across OTAs.

This CL makes profile removal a dedicated path which will be called by
PackageManger during an app update or uninstall.

Profiles are cleared when:
- requested to do a full clean up of application data files
- specifically requested to clear them (e.g. app updates)

Profiles are destroyed (includes profile directory removal)
- for each user individually when its application data is destroyed
- for all users if the package gets uninstalled.

Bug: 27081617
Bug: 27688727
Change-Id: Id53c7625011af3cdbe8a58ac0982982fa461e5fd
/frameworks/native/cmds/installd/commands.cpp
4d0f825dd76a1972a3d081e771cde28513a1c6ff 20-Mar-2016 Andreas Gampe <agampe@google.com> Installd: Separate profile merging and compilation

Create a new merge_profiles command to check and merge profiles.

(Almost) always pass a profile to a dexopt pass.

Require compilation filter input to dexopt and use it for dex2oat
(except for hard overrides like safe-mode).

Bug: 27689078
Change-Id: I1257857cc15c17e2271d1261ea4cc80752270fcb
/frameworks/native/cmds/installd/commands.cpp
caa6b809a5ed024a8f3f551c5c109a5ad50ab772 22-Mar-2016 Calin Juravle <calin@google.com> Delete the entire profile directory when the app is uninstalled

We were deleting just the files themselves. We need to delete the
directory as well.

Bug: 27696217
Change-Id: I202a52c711a2132ba10b926f4d0e9ec953f25b43
/frameworks/native/cmds/installd/commands.cpp
bb7a77082fde8f73971adadf50faecdf5f660b48 16-Mar-2016 Andreas Gampe <agampe@google.com> Installd: Make extract-only = interpret-only

Test the impact of verifying and quickening at install time and
post-OTA boot time.

Bug: 26833007
Bug: 27688727
Bug: 27689078
Change-Id: Ib2ebe71747f2b8dc7a2864f3d02b5c2217d29d6c
/frameworks/native/cmds/installd/commands.cpp
2438c6f59cc293a887e65cd34738889043a75d46 11-Mar-2016 Andreas Gampe <agampe@google.com> Installd: Do not log on missing B artifact

For now, just swallow the warning.

Bug: 25612095
Change-Id: Ib7131464c7eb85c153cb91bf5ff9dc2a6127dd4c
/frameworks/native/cmds/installd/commands.cpp
d828d6839f6a01e3f0b2b8b2694139dfa801c557 08-Mar-2016 David Brazdil <dbrazdil@google.com> Add 'rmprofiles' command to installd

Adds a new command to installd which clears all profile data of
a given package.

Bug: 27516490
Change-Id: I92cc374b5b6d95ca7755e08b95a9bc9060df2178
/frameworks/native/cmds/installd/commands.cpp
e65b4faa798269ab6ee0d27dab03b8b5caa6f956 01-Mar-2016 Andreas Gampe <agampe@google.com> Installd: Add move_ab command

Add a command to move A/B artifacts into the right position. This
is used for apps that live in data.

Bug: 25612095
Change-Id: I40c3ca54bd0f3b2d646a14b145e733096dabbbb2
/frameworks/native/cmds/installd/commands.cpp
0258add8ec3269a70607d4d9fd4d90d2b9b83f67 02-Mar-2016 Calin Juravle <calin@google.com> Merge "Clean up error logs for profiles which don't exists." into nyc-dev
db0326a56ed8cc1ba2ed5ec2810afe49bcd9a596 23-Feb-2016 Calin Juravle <calin@google.com> Return an error if try to profile guide compile to a public oat file

This makes sure that the oat file access is private to the app when
using profiles.

Bug: 27334750
Bug: 26080105

Change-Id: I9f5deec1a1068d0276928117134956eb233ce504
/frameworks/native/cmds/installd/commands.cpp
278edac4b541e0a671d646a0e17bdbea411c8a08 29-Feb-2016 Calin Juravle <calin@google.com> Clean up error logs for profiles which don't exists.

Bug: 27401160
Change-Id: I60f23477e90052c00fb1c1cc5abe827f4270cd07
/frameworks/native/cmds/installd/commands.cpp
6a1648e2f161cb1d7c46aa9d27e8062521a9f314 01-Feb-2016 Calin Juravle <calin@google.com> Extract profile files in their dedicated folder

Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.

Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname.

The profile analysis flow has been changed to use profman
before calling dex2oat. profman decides if there is a need
for compilation and does the merging.

Bug: 26719109
Bug: 26563023
Bug: 26881016

Change-Id: I5a86ed5fd07a28e2e580f9c108428527ba7993b6
/frameworks/native/cmds/installd/commands.cpp
2f6d9e2fec8ab76ce35d5d6dee0a7838fc10b66c 17-Feb-2016 Narayan Kamath <narayan@google.com> installd: fix path to code_cache.

Now exists in user_de, not user.

bug: 27216576
Change-Id: I9d50d9584de7b349fc9dfc829b690c20dd02eccd
/frameworks/native/cmds/installd/commands.cpp
cc6281cf8146cddb8ace7cbd58c67321639c1520 07-Feb-2016 Jeff Sharkey <jsharkey@android.com> Migrate default app data on non-FBE devices.

When a system app requests "forceDeviceEncrypted" they expect their
default app storage to point at a consistent location regardless of
device FBE support. So when booting upgraded non-FBE devices, we
may need to migrate any data from CE to DE. Note that on non-FBE
devices these are just semantic locations with identical protection.

This migration *only* works for non-FBE devices; changing
forceDeviceEncrypted flags on an FBE device always requires a full
data wipe.

Bug: 26668510
Change-Id: I8bd5b8ba882e6bd067c0381041b27c35d6e47788
/frameworks/native/cmds/installd/commands.cpp
6a45fb96bcc67f8266ec4c3aac513d64cd751610 05-Feb-2016 Jeff Sharkey <jsharkey@google.com> Merge "Follow constant refactoring in framework."
aaa1d4e930f653ec21b711eb852194c8abf35143 05-Feb-2016 David Brazdil <dbrazdil@google.com> installd: Run dex2oat with relative path to the APK

Previous CL (I6aaddffe79c55b9a6560c2d6542cf87abbd4fb11) started
passing the absolute path of an APK to dex2oat. This renders APKs
dexopted while in a temporary folder during install out-of-date when
moved to the final location.

Bug: 26409579
Change-Id: Icccf2d1bb34e2d5f4d98efae3c8f5609784abafd
/frameworks/native/cmds/installd/commands.cpp
aa7ddfd8347fa947618a7668b013521e95722c5c 03-Feb-2016 Jeff Sharkey <jsharkey@android.com> Follow constant refactoring in framework.

Bug: 25796509
Change-Id: Ib19aa570fb5fbf26752c5487f1221c9959b1143a
/frameworks/native/cmds/installd/commands.cpp
41fdcbfa119698122cae9913ea85ea1d2cf9668a 03-Feb-2016 Mathieu Chartier <mathieuc@google.com> Create app images only if dalvik.vm.appimageformat property exists

If the dalvik.vm.appimageformat property does not exist, do not
generate an application image.

Other improvements:
unlink app image if the property is not set, or we are extract only.

Bug: 22858531
Change-Id: I50d8b66787a4e8b6135ad2b00744c7f1ae7c7f53
/frameworks/native/cmds/installd/commands.cpp
416fa12cd0949c7f12e2067b36ac7ac64ba70b4a 03-Feb-2016 Mathieu Chartier <mathieuc@google.com> Pass app image format property to dex2oat

Enables using lz4 for app images.

Bug: 22858531

Change-Id: Ife2bca8883c2868d30b45e0eec210f96d589068e
/frameworks/native/cmds/installd/commands.cpp
e80d58db65d29ed4647e631a81aed644fea00913 03-Feb-2016 Mathieu Chartier <mathieuc@google.com> Avoid generating app images for extract only

The extract only app images have no resolved classes and only
contain dex cache arrays.

Bug: 22858531
Change-Id: I4351ef374f66d2882cc23fca14495e63a0e30e89
/frameworks/native/cmds/installd/commands.cpp
310c5e70b2e36df36811b6de7ad5c2ebd82338e5 29-Jan-2016 Mathieu Chartier <mathieuc@google.com> Avoid unlinking app image file

Avoid erasing the image file in installd in case we abort compilation
due to no new profile data. This prevents the application image file
being turned into a 0 byte file in this case.

The ART image writer erases the file before writing.

Bug: 22858531
Change-Id: I0b35905698662cef80eecfc350e5504bf62a5ac1
/frameworks/native/cmds/installd/commands.cpp
e37d62803210f258ddb843c7d8d0494127069342 29-Jan-2016 Jeff Sharkey <jsharkey@android.com> Remove "updatecmds" feature.

This feature is very old and hasn't been used in many releases. In
addition, it was never taught about multi-user layouts, and it would
be incredibly hard to maintain in the new FBE world where CE keys
may not appear until several reboots after an OTA.

Bug: 26854442
Change-Id: Ibd8660e2a727469cd5ae41dab5e1014a9cfb6748
/frameworks/native/cmds/installd/commands.cpp
edc8bc48fbf143e35578bf6cccf980dfab076196 21-Oct-2015 Mathieu Chartier <mathieuc@google.com> Pass application image fd to dex2oat

Open application image and pass the fd to dex2oat.

Bug: 22858531

Change-Id: I5a9dfcf67d2232e8755886085e9ba1bb37494d39
/frameworks/native/cmds/installd/commands.cpp
b0fad6d04ba05fbad5ce31c7382be174ed5a70b1 30-Dec-2015 David Brazdil <dbrazdil@google.com> installd: Rename USEJIT to EXTRACTONLY

Change-Id: I8d68e32dd9bbb7f6eee2f3aad886792d85cb12ca
/frameworks/native/cmds/installd/commands.cpp
9a034c2ada5bd513619b72729071a10528f158ad 19-Jan-2016 Calin Juravle <calin@google.com> Merge "Add profile guided compilation hooks in installd"
60a794dc845b942907ca035ddc554eb8e0c7ebb6 23-Dec-2015 Calin Juravle <calin@google.com> Add profile guided compilation hooks in installd

Bug: 26080105
Change-Id: I6aaddffe79c55b9a6560c2d6542cf87abbd4fb11
/frameworks/native/cmds/installd/commands.cpp
eecb2d205366351af42fd0cd9e1a95de3980764e 12-Jan-2016 Janis Danisevskis <jdanis@google.com> Change permissions of apps' home dir to 0700 for SDK > 23

This patchset changes the installd such that apps' home
directory has permissions set to 0700 if build for a
target SDK version. In consequence the commands

create_app_data and move_complete_app

get one more parameter, the target SDK version.
Apps built for a lower SDK version will still have
home directories with permissions set to 0751.

Bug: 7208882
Change-Id: I0213834dd946c72f5d7e31965a9dc517ced268db
/frameworks/native/cmds/installd/commands.cpp
a03c747ff6e1afb5c1dc86560705bd979cd5c49f 13-Jan-2016 Jeff Sharkey <jsharkey@android.com> Still not safe to mutate DE on secondary users.

Bug: 25796509, 26535916
Change-Id: I694b4a1b5fe3e31578f431bcddf7d6c4070f7852
/frameworks/native/cmds/installd/commands.cpp
c7d1b2250e8245a7e4e144758bc3ccd33b8d6319 11-Jan-2016 Jeff Sharkey <jsharkey@android.com> Let callers specify which storage to operate on.

Since CE and DE storage can have different availability lifecycles,
callers can't operate on both at the same time. Let them use flags
to specify which storage to work with.

Remove old unused methods, and name consistently in preparation for
eventual move to AIDL.

Bug: 26466827
Change-Id: Id5d7d03f5d8814864eea801f5a46496c085afdff
/frameworks/native/cmds/installd/commands.cpp
02d0de56c75347a0cb8d5a8565dc8c4ee7616057 12-Nov-2015 Andreas Gampe <agampe@google.com> Installd: Refactor in preparation for OTA

Refactor installd code so reuse with a few key plugin functions is
possible. Do a bit of code cleanup.

Bug: 25612095
Change-Id: I544604f0a391583a4c07887a8234343a3a255942
/frameworks/native/cmds/installd/commands.cpp
32717f851ec39e44b43dcd2053b091daff5e1753 07-Dec-2015 Todd Kennedy <toddke@google.com> Merge "Create new ephemeral app directory"
c7b8a11974f0bf0b13f47b9fb40059b1c50ec9b6 05-Dec-2015 Elliott Hughes <enh@google.com> Merge "Track rename from base/ to android-base/." am: f31cf3ab0f am: c21980bc12
am: 803823f8b6

* commit '803823f8b6663578922be595755351a9e710d93c':
Track rename from base/ to android-base/.
e4ec9eb7b4c452493589983970ba5ccc501728d1 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename from base/ to android-base/.

Change-Id: I62c18891ffe319d20ff084f5ca2aa0c038c23cd3
/frameworks/native/cmds/installd/commands.cpp
5c1a910e6a2d2c42002dc6ed88ff770336afcb3f 24-Nov-2015 Todd Kennedy <toddke@google.com> Create new ephemeral app directory

Bug: 25119046
Change-Id: I829f7ae1df09f2b7af1cd64fbbad6c1f5a2d716d
/frameworks/native/cmds/installd/commands.cpp
a749eb554e49a01ec1e203b1dd530c6336cdc704 19-Nov-2015 Jeff Sharkey <jsharkey@google.com> Merge "Temporarily relax device-encryption failures."
ea0e4b19d942f62ea21ca4e70f939f3d4aa14b37 19-Nov-2015 Jeff Sharkey <jsharkey@android.com> Temporarily relax device-encryption failures.

Long-term fix is to get vold connected before doing initial package
scan, and prepare all user directories.

Bug: 25796509
Change-Id: Ibcfc44411e9921cf3fa3d0510d300808a2a62e7e
/frameworks/native/cmds/installd/commands.cpp
23294f4cdfbc37bdf66885d07b87d11348be6972 19-Nov-2015 Jeff Sharkey <jsharkey@google.com> Merge "More device-encrypted directory work."
ebf728fd43ab5c7d11a1f9e5fdc775d6740fae0a 18-Nov-2015 Jeff Sharkey <jsharkey@android.com> More device-encrypted directory work.

Unify package directory creation logic, and always create user_de
directories to be ready for emulation mode. Also clean up the new
user_de directories on user deletion, package uninstallation, and
data clearing. Also run restorecon over the new user_de paths.

Bug: 22358539
Change-Id: I65ab1562db8455dae6e99dbd8965409b1bf3c6b0
/frameworks/native/cmds/installd/commands.cpp
2e1d20d3cff8835b5aeab7adf3d137a87579e9ef 19-Nov-2015 Todd Kennedy <toddke@google.com> Merge "use negative mask" am: 4e427f0aab am: 469295f68e
am: d0711b42b7

* commit 'd0711b42b757bcc4ffc2ad8a9989cf728d4bb034':
use negative mask
f24aae872d79982899fed4911141b05c874b0c50 18-Nov-2015 Calin Juravle <calin@google.com> Merge "Remove obsolete profile handling from installd." am: 8161da7a0e am: a51f45a601
am: 357cb908fa

* commit '357cb908faa88b915c1d2c977f16e533e855f19f':
Remove obsolete profile handling from installd.
e296e00df65461629a20cd03b5b041a59935d00f 16-Nov-2015 Todd Kennedy <toddke@google.com> use negative mask

the test should be for _invalid_ bits; as it's written,
it tests for valid bits

Change-Id: Id5e42e865449a7877fe58aca9fb47675fa7452c9
/frameworks/native/cmds/installd/commands.cpp
63ec2d64196144b2d15d2baffedccfa011d6494f 09-Nov-2015 Jeff Sharkey <jsharkey@android.com> Create device-encrypted directories for apps.

When device has FBE, create device-encrypted storage location when
installing apps.

Also remove "renamepkg" unused command.

Bug: 22358539
Change-Id: Ic56eeecdc64bdaa7429b93426727a243a4e45f47
/frameworks/native/cmds/installd/commands.cpp
df9dadd5e5c287110d837c38aaec12bcf5e5d151 04-Nov-2015 Calin Juravle <calin@google.com> Remove obsolete profile handling from installd.

Bug: 24698874
Bug: 17173268
Change-Id: I140d70262f8f8fa7afd52c3cf63b4abaf401a479
/frameworks/native/cmds/installd/commands.cpp
54412fe2ae0fb5a9dc81b999d726b5a909de3bd7 28-Sep-2015 Andreas Gampe <agampe@google.com> am 28b1d678: Merge "Installd: Fully decouple pre- and post-bootcomplete properties"

* commit '28b1d678a4721e9f02b7b9498492fb3d623f21be':
Installd: Fully decouple pre- and post-bootcomplete properties
28b1d678a4721e9f02b7b9498492fb3d623f21be 28-Sep-2015 Andreas Gampe <agampe@google.com> Merge "Installd: Fully decouple pre- and post-bootcomplete properties"
919461cbeef3e9f35388fc099a5fcdae1cb79cc6 28-Sep-2015 Andreas Gampe <agampe@google.com> Installd: Fully decouple pre- and post-bootcomplete properties

Do not fall back to dalvik.vm.dex2oat-threads if
dalvik.vm.boot-dex2oat-threads is not set. Also do not ever use
the value of dalvik.vm.image-dex2oat-threads. Instead use the
default behavior of dex2oat in that situation.

Change-Id: I42e60996341414b95b8df2d243d5e07f7f5ff9b6
/frameworks/native/cmds/installd/commands.cpp
534a49dc3282d1056f92c7ed6e0ef7fa2f9ec74e 28-Sep-2015 Todd Kennedy <toddke@google.com> am 905c1446: Merge "Allow using the JIT"

* commit '905c1446ea602b4649a248bfe878626cae01a87a':
Allow using the JIT
12434f8cce66a753ef49c07b503f9625e01366c8 25-Sep-2015 Todd Kennedy <toddke@google.com> Allow using the JIT

Instead of the JIT only being available for eng builds [or configurable
via environment variable], allow the JIT to be enabled programatically.

Change-Id: Id3c5ae227ed400e489bb723a56c516dfc12acd89
/frameworks/native/cmds/installd/commands.cpp
a5359950298f0bd5833ab72b7a26aef9fc45056f 26-Sep-2015 Todd Kennedy <toddke@google.com> am d529cd47: Merge "Pass dexopt flags as integer"

* commit 'd529cd470afa98512bf2eab7a58dae5a9b6e4847':
Pass dexopt flags as integer
76e767ca14bcbb4bc809cd1279ece82a3aabe8a4 25-Sep-2015 Todd Kennedy <toddke@google.com> Pass dexopt flags as integer

Instead of using a series of booleans, create a single flags integer
that contains all of the dexopt options.

Change-Id: I35542aa73ca57b0e765d19b1339b1429849c1ae8
/frameworks/native/cmds/installd/commands.cpp
a037f97dcf15000154e73aea4e92248c17a586f8 24-Sep-2015 Todd Kennedy <toddke@google.com> am 7f413889: Merge "Installd: Take boot status as dexopt parameter"

* commit '7f413889a3f0bff0c159141abb498650305f2089':
Installd: Take boot status as dexopt parameter
13f141910ba383404145924df64ad6626fe5b42f 21-Sep-2015 Andreas Gampe <agampe@google.com> Installd: Take boot status as dexopt parameter

Expect the boot status explicitly as a parameter so that we do not
have to rely on dev.bootcomplete, which isn't meaningfully set
when the device needs the decryption screen on boot.

Bug: 23898216
(cherry picked from commit 72ebebed876a62e719b098e43d9d516361bde029)
Change-Id: I9b34298caf70b1e5d40970cc0d04c469016a80a7
/frameworks/native/cmds/installd/commands.cpp
ebb28d9d614fb7b25406429c339cd3e0247500f2 18-Sep-2015 Andreas Gampe <agampe@google.com> am c5a6696f: Merge "Installd: Allow different behavior before bootcomplete"

* commit 'c5a6696f3e51e253b78baacdec99ed34e79bc3fd':
Installd: Allow different behavior before bootcomplete
94dd3d3c5be4de57278ee668218a3464585795c0 15-Sep-2015 Andreas Gampe <agampe@google.com> Installd: Allow different behavior before bootcomplete

Check dev.bootcomplete in dex2oat(). Use the information for
two changes.

Only switch to the background when we're post bootcomplete.
This will ensure better utilization after upgrades.

Add a second dex2oat-threads property that is used pre
bootcomplete. A separation of these phases allows using less
cores when the device is up, freeing up resources for other
purposes, e.g., avoid jank. The precedence during boot is the
boot property, or the image property if the former doesn't
exist, or the default property as a fallback.

Bug: 23898216
Bug: 24004256

(cherry picked from commit 21948005f0294a64a42932b21a33ae75295dc3d9)

Change-Id: I5063f3fc4b437cbe88c4e94584e01c1c78eccc4d
/frameworks/native/cmds/installd/commands.cpp
a2307aefd06f1310660ef1d35ce01bcfc72c9633 21-Jul-2015 Jeff Sharkey <jsharkey@android.com> Only restorecon_data once for all users.

restorecon_data already iterates across all found users internally,
so we don't need to call it for each UID moved. In fact, this was a
bug that caused data for the owner to be relabeled when moving apps
back to internal storage.

Bug: 21813384
Change-Id: I5ba76d4f30d129365864c8a25b665f344b99a6b4
/frameworks/native/cmds/installd/commands.cpp
5041a4e6bf7364653c69e2e39f95cf1087163459 17-Jul-2015 Andreas Gampe <agampe@google.com> Installd: Add a swap override flag

Add dalvik.vm.dex2oat-swap system property to override a default
decision.

Bug: 20658562

(cherry picked from commit c968c0175e967e39e72f557b5e014b9575ba4727)

Change-Id: I34368c6e435d1a9ceec20a0bf1c8c6213e527f5e
/frameworks/native/cmds/installd/commands.cpp
c968c0175e967e39e72f557b5e014b9575ba4727 17-Jul-2015 Andreas Gampe <agampe@google.com> Installd: Add a swap override flag

Add dalvik.vm.dex2oat-swap system property to override a default
decision.

Bug: 20658562
Change-Id: I34368c6e435d1a9ceec20a0bf1c8c6213e527f5e
/frameworks/native/cmds/installd/commands.cpp
31f08986f83fa6f2dcf55523b2cf706460aeed7c 07-Jul-2015 Jeff Sharkey <jsharkey@android.com> Split app move into separate copy/delete steps.

App movement now has three distinct stages: copying, scanning, and
cleanup. Previously, a battery pull late in the move process would
end up with packages.xml pointing at the old location which had been
torn down. Now, we update packages.xml to point at the new location
as the "source of truth" before we start deleting the old location.

Bug: 21831336
Change-Id: I62b8916c673265c240e2574ea968cdce5a7a0074
/frameworks/native/cmds/installd/commands.cpp
1bcb35bf87cc2f7ef6c8a26238910ca9b88ea73d 25-Jun-2015 Hao Li <hao.i.li@intel.com> Installd: Fix delete_code_cache() clearing the wrong cache dir

Fix a typo in delete_code_cache() introduced by commit c03de09, which
causes the function to empty /data/data/<package_name>/cache/ rather
than /data/data/<package_name>/code_cache/.

The following CTS test case should now pass:

com.android.cts.appsecurity.SplitTests#testClearCodeCache

Change-Id: I2d9452d70ed39b3ea29ad65fb35e788c2fef5100
Signed-off-by: Hao Li <hao.i.li@intel.com>
Signed-off-by: Yu Ning <yu.ning@intel.com>
/frameworks/native/cmds/installd/commands.cpp
a2ccb9e43db52a18d088c1d440676335cb4b9e68 24-Jun-2015 Daichi Hirono <hirono@google.com> Fix directory path of codecache.

Previously installd removed the normal cache directory when delete_code_cache is
called. It should delete the code cache directory.

BUG=21206499

Change-Id: I5774430e389e22805fa7984b4c83420c3677ca75
/frameworks/native/cmds/installd/commands.cpp
528c8ddc60df7b3d291b389117e4db878a20ad48 28-May-2015 David Srbecky <dsrbecky@google.com> Rename --include-cfi to --generate-debug-info.

This follows a change in dex2oat.

(cherry picked from commit 741a6ff2e264b96edbca3ac95e720b21c8e39382)

Bug: 21924613
Change-Id: I6b2df1668fdd09d82cfe86e6e51360b954b6c8a9
/frameworks/native/cmds/installd/commands.cpp
3822b8b79cf533ee8573794176838406c32a1c20 24-Apr-2015 Andreas Gampe <agampe@google.com> Installd: Add debug.gencfi to run_dex2oat

Add the debug.gencfi system property that forces generation of
CFI data.

(cherry picked from commit 816243d470bade03c264e67e39590f6852581898)

Bug: 21924613
Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
/frameworks/native/cmds/installd/commands.cpp
d845c96128a40ca5802c0840ae190fa0af7d4735 04-Jun-2015 Narayan Kamath <narayan@google.com> Add an installd command to link files

Given a pair of absolute paths {from_path, to_path} , check that
they are both valid apk subpaths (eg. /data/app/package/foo) and
link(2) to_path to from_path. This is required by staged installs,
where we link existing apks and oat files to their staging location.

bug: 20889739
Change-Id: I3b5e3b43677af68be59308121a4409caaa6a72f0
/frameworks/native/cmds/installd/commands.cpp
741a6ff2e264b96edbca3ac95e720b21c8e39382 28-May-2015 David Srbecky <dsrbecky@google.com> Rename --include-cfi to --generate-debug-info.

This follows a change in dex2oat.

Change-Id: I6b2df1668fdd09d82cfe86e6e51360b954b6c8a9
/frameworks/native/cmds/installd/commands.cpp
d792118c493806eeb24a8203f508e6e18fe93bd7 01-May-2015 Jeff Sharkey <jsharkey@android.com> Offer to move both code and data together.

We now move code under /data/app/com.example when a complete move
is requested. This really only works for new cluster-style installs
that also have native libraries and OAT contained inside.

Teach measuring code about cluster-style installs when measuring
app footprint. Also offer to measure private data space for all
users.

Bug: 19993667, 20275578
Change-Id: I6df7b947cb5cc8a4552f56f4b64a661e8512389f
/frameworks/native/cmds/installd/commands.cpp
816243d470bade03c264e67e39590f6852581898 24-Apr-2015 Andreas Gampe <agampe@google.com> Installd: Add debug.gencfi to run_dex2oat

Add the debug.gencfi system property that forces generation of
CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
/frameworks/native/cmds/installd/commands.cpp
e36372423000a906bafae68844ebc6c42d09335a 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> Command to move private app data between volumes.

New "mvuserdata" command will move all private app data from one
volume UUID to another. It leverages the existing "cp" toybox
command to do the heavy lifting for all known users, preserving
details like timestamps and permissions. It invokes restorecon()
to correctly label the new location when the copy is finished.

Changes installd to no longer drop capabilities, so we run as root
again. This also allows us to exec "cp" with CAP_DAC_OVERRIDE and
CAP_FOWNER still in effect.

Bug: 19993667
Change-Id: I1f407a7c4a1af97ca5afc27b04eb16b4936cbdef
/frameworks/native/cmds/installd/commands.cpp
6fe28a06012250da85f808a0869f87e06e0bcce9 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> Start accepting volume UUIDs from framework.

We're now parsing and passing through volume UUIDs sent across the
command socket. The "!" argument value is treated as null, which
means internal storage.

Bug: 19993667
Change-Id: I17729a769ce687a2e94e85991a6338c77ded0b66
/frameworks/native/cmds/installd/commands.cpp
41ea424413c0381ef2aa15fc5bd5d4b88abd23c4 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> More volume UUID awareness.

Teach free_cache() and restorecon_data() about building per-volume
paths. Also clean up restorecon_data() by using std::string when
building paths.

Clearer names for path building utility methods, and tests to verify.

Bug: 19993667
Change-Id: Iacfbcdaa5b901cc2490bc8eba366dfdeb44f1d93
/frameworks/native/cmds/installd/commands.cpp
0ad7a11003ad76381452c3751368b8e3f42b1f6a 09-Apr-2015 Andreas Gampe <agampe@google.com> Installd: Fix Clang build

Remove some unused parameters and variables.

Change-Id: I507ae48fe1744b800ceb29192d463fd26c2ccda7
/frameworks/native/cmds/installd/commands.cpp
d107c305f74592e8078754b317d840a2dde661db 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> Merge "Plumb through volume UUID when building paths."
c03de09173f98506e73e7cf7df21fe11795d4b24 08-Apr-2015 Jeff Sharkey <jsharkey@android.com> Plumb through volume UUID when building paths.

Since app data paths can live on expanded storage devices, accept the
target volume UUID when building paths. The null UUID indicates the
default internal storage.

To improve readability, start using std::string in several places,
which throws when allocations fail. For now, perform last-second
sanity checks on incoming path arguments, but we'll eventually want
to check arguments as they come through installd.cpp, instead of
crashing the entire daemon.

Also remove "lib" symlink code from install() and make_user_data(),
since we're no longer supporting /data/app-lib. The framework
already uses linklib() to create the right symlink for the selected
ISA-specific library dir.

Bug: 19993667
Change-Id: Ib9343575ffb62bf3981e19375de8f3822fc31e28
/frameworks/native/cmds/installd/commands.cpp
c92fb6247d4c4fbc34c0a5deb26ccf538ca9ec81 26-Mar-2015 Richard Uhler <ruhler@google.com> installd: Add support for SELF_PATCHOAT_NEEDED.

Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
/frameworks/native/cmds/installd/commands.cpp
19803807cd7ae01868fcfa50305f4a7dd13765e2 07-Apr-2015 Jeff Sharkey <jsharkey@android.com> Switch installd to compile as C++.

This is the minimal change needed to switch it over to C++, which
paves the way for using more robust utilities like std::string.

Change-Id: I80ed6280146875eb6ddbbb340c05450388ca13f0
/frameworks/native/cmds/installd/commands.cpp