History log of /frameworks/native/cmds/installd/installd.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/installd.h
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/installd.h
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/installd.h
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/installd.h
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/installd.h
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/installd.h
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/installd.h
c92fb6247d4c4fbc34c0a5deb26ccf538ca9ec81 26-Mar-2015 Richard Uhler <ruhler@google.com> installd: Add support for SELF_PATCHOAT_NEEDED.

Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
/frameworks/native/cmds/installd/installd.h
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/installd.h
e23a13299a4f6f2488935b4786cdbb46f46e3d3c 07-Apr-2015 Jeff Sharkey <jsharkey@android.com> Valid APK paths now include expanded storage.

Apps on expanded storage live at /mnt/expand/<uuid>/app/com.example,
so we need to relax one more directory level.

Bug: 19993667
Change-Id: I347ec7b92435ea69e632ed5d5fdfabe38ce0b56e
/frameworks/native/cmds/installd/installd.h
88ce4ff7a95ea2008fa28f12b880ee526e331440 03-Mar-2015 Fyodor Kupolov <fkupolov@google.com> Support for storing OAT files in app directory

Changes to installd:
- dexopt now allows oat_dir param for custom output directory
- Added helper method calculate_oat_file_path for calculating oat file
output location based on oat_dir and apk_path.

Bug: 19550105
Change-Id: I6b079207310583adeb6dad918a58034a059e34c4
/frameworks/native/cmds/installd/installd.h
598c25e23f7c97470e09a2316513ddf2efdfb670 03-Mar-2015 Andreas Gampe <agampe@google.com> Installd: Pass debuggable flag

Pass the debuggable flag from the package manager to dex2oat.

Change-Id: Id17ec72babe2ee88713a0d274eff86508de30666
/frameworks/native/cmds/installd/installd.h
ba4a43c6c78547444446181b4fae20a5d61d35ff 20-Nov-2014 Elliott Hughes <enh@google.com> Merge "Kill INCLUDE_SYS_MOUNT_FOR_STATFS."
9a4e7f492e6e80bb171111d307658be7e2132ae3 20-Nov-2014 Elliott Hughes <enh@google.com> Kill INCLUDE_SYS_MOUNT_FOR_STATFS.

Change-Id: I692179cae9d476dd5a0b5fa92813b61934dd7c87
/frameworks/native/cmds/installd/installd.h
091ea779d4e575856c04d51d82f45cc8a6155b5e 10-Nov-2014 Narayan Kamath <narayan@google.com> Add an installd command to mark the end of boot.

bug: 18280671

(cherry picked from commit b1a6c2f95a455aa2829340fcc8d233493855f4d4)

Change-Id: I97542875ffff1b68ab324e9b04fb9266c82633cc
/frameworks/native/cmds/installd/installd.h
60fd3feecab4336d964ca8e31c7c3220e1afb558 07-Oct-2014 Robin Lee <rgl@google.com> Migrate CA certificates to all users

Copies the /data/misc/keychain/cacert-* directories to all users on
the device, whereas previously they were simply copied to user 0.

This is a shallow copy so anything that wasn't supposed to be there
will disappear.

Bug: 17811821
Change-Id: Iae5909ab8d5efdb83c9c8fdf0e10ab7060d022cc
/frameworks/native/cmds/installd/installd.h
770180a4dd86f8bda6af2e6db4676e99a5bb1548 09-Sep-2014 Jeff Sharkey <jsharkey@android.com> Add new system APK locations.

Add /system/priv-app and /oem/app paths to system paths. Also allow
rmdex on system apps, and quietly ignore when it was already removed.

Also relax logging when clearing code cache, since it's optional.

Bug: 17205122
Change-Id: I4fc4d0f63a3596937c4defbd64e1f8a1c563f02d
/frameworks/native/cmds/installd/installd.h
8b17ac6bd6b5114babac619cad3ff03fbf10a953 29-Aug-2014 Alex Light <allight@google.com> Remove obsolete prunedexcache

Bug: 16875245

(cherry picked from commit 5f727f86942a188354c028356f1167794fdc8655)

Change-Id: I06e14c405aa4af295795982c1d236be3cb00e893
/frameworks/native/cmds/installd/installd.h
b1efac103523efccbe671e76cc0eaaeab810415b 21-Aug-2014 Calin Juravle <calin@google.com> Add vm_safe_mode to dexopt.

The flag enforces interpret-only flag for dex2oat.

Bug: 12457423
Change-Id: Ifdafcc1afa32996577fa44c5682eeb58c79772ac
/frameworks/native/cmds/installd/installd.h
43c5d30795faf08ab639b8d88c2eceaf2b648c93 21-Jul-2014 Alex Light <allight@google.com> Make system use patchoat to relocate during runtime.

Make installd understand a patchoat directive and carry it out.

Bug: 15358152

(cherry picked from commit 7365a10689df23334d245b211ce272502ad20669)

Change-Id: Id84a15e626ddde63876914068d3d9aa037abc65b
/frameworks/native/cmds/installd/installd.h
c796b681e52fbb792da9a5b4f30e935cc927c1d7 16-Jul-2014 Jeff Sharkey <jsharkey@android.com> Offer to delete code cache directories.

Bug: 16187224
Change-Id: Ia860b051a34ffdfb4f6e0ea19f90cb73509c4eee
/frameworks/native/cmds/installd/installd.h
7c5be65f2819bf0328715bc405483788dd7a81f2 09-Jul-2014 Robin Lee <rgl@google.com> Merge "Rename 'mkuser' command to 'mkuserconfig'"
1e57e4af8afb5a3b8b657e1c9ca3f9810e266083 17-Jun-2014 Narayan Kamath <narayan@google.com> Exclude subdirectories when pruning the dex cache.

This requires a companion package manager change to prune
each instruction specific dex cache individually.

bug: 15677279

Change-Id: I5891981512bde20e49bff65b1842c28886f2b177
/frameworks/native/cmds/installd/installd.h
8c9bcff892ae30897a971c3b97305e70db5b5bd3 16-Jun-2014 Narayan Kamath <narayan@google.com> Merge "Add an installd command to prune dex files."
7c8bec01790087748ec7afa69a31789828b751f9 10-Jun-2014 Robin Lee <rgl@google.com> Rename 'mkuser' command to 'mkuserconfig'

Brings the name more in line with what it actually does.

Change-Id: I0adb14deb1a035abdbe51714356bd0c94ccf04c5
/frameworks/native/cmds/installd/installd.h
3aee2c5c749dc2589f001b26fae1ec958ec89524 10-Jun-2014 Narayan Kamath <narayan@google.com> Add an installd command to prune dex files.

This is a straightforward port of logic from
PackageManagerService#pruneDexFiles.

bug: 14407732

Change-Id: I892cff027ddcbb1a4fb37a7af5ecf1697049a188
/frameworks/native/cmds/installd/installd.h
095c763dd9aa26a206d10ab7c1d7e1c569298fb3 25-Apr-2014 Robin Lee <rgl@google.com> Add installd command to create /data/misc user dir

New command 'mkuser <id>' sets up a user directory in /data/misc/user/,
readable by all apps within that user and writeable by the local system
process.

Change-Id: I5ddde8c4a80f606e723bb41aa64581a0720842d5
/frameworks/native/cmds/installd/installd.h
1b4003207750ea8fe8c7b03eb32d80f1df83979e 11-Apr-2014 Narayan Kamath <narayan@google.com> Add instruction-set arguments to installd commands.

The instruction-set is used to construct the dalvik cache
path and is also passed down to dex2oat.

(cherry picked from commit 791781bfb8cdcdf90e32968159603e2fe5098d94)

Change-Id: I43396b16f6eaecacf0fb7d052526fc5a239167ac
/frameworks/native/cmds/installd/installd.h
e9887e46cea4a095e4219927eadbe4c57bb1a5ee 20-Feb-2014 Robert Craig <rpcraig@tycho.ncsc.mil> Extend installd to support SELinux restorecon function.

Implement new restorecondata function which will allow
the relabeling of /data/data and /data/user directories.
This is needed in the case of certain OTAs. Not every
boot will apply this relabeling however. Consult change
I77bf2a0c4c34b1feef6fdf4d6c3bd92dbf32f4a1 for
clarification on this issue.

Change-Id: I05e8b438950ddb908e46c9168ea6ee601e6d674f
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.h
d93707342a61e66bc3eb2145628158452f577f42 30-Jan-2014 Dave Allison <dallison@google.com> ART profiler

Add args to the installd commands for profiler usage.
Make installd create the profile files and allow apps
to write to them.

The profile files are in /data/dalvik-cache/profiles. This
central location is needed due to permissions issues with
dex2oat reading from an app's data directory. The solution
is to put the profile file in a directory owned by the
install user and make the file writeable by the shared group
id of for the app. The app can read and write to these files
only in the profiles directory. The 'system' user also needs
to be able to read the files in order to determine the amount
of change to the file over time.

Bug: 12877748
Change-Id: I9b8e59e3bd7df8a1bf60fa7ffd376a24ba0eb42f

Conflicts:
cmds/installd/commands.c
/frameworks/native/cmds/installd/installd.h
63568b1430d741f40ca008391c854ef1cc880138 31-Jan-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

<overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
Initial AssetManager object created
+ idmap --scan creates idmaps for overlays targeting 'android', \
stores list of overlays in /data/resource-cache/overlays.list
AssetManager caches framework-res.apk
+ AssetManager caches overlay packages listed in overlays.list

Android boot
New AssetManager's ResTable acquired
AssetManager re-uses cached framework-res.apk
+ AssetManager re-uses cached 'android' overlays (if any)

App boot
ActivityThread prepares AssetManager to load app.apk
+ ActivityThread prepares AssetManager to load app overlays (if any)
New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

<overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

+------+------+- -+------+------+
| 0x01 | | ... | | 0x7f |
+------+------+- -+------+------+
| |
"android" Target package A
|
Pre-installed overlay B (priority 1)
|
Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
/frameworks/native/cmds/installd/installd.h
e4e91c4ead821afb5aced2e33ee39d8878eb4d1e 20-Sep-2013 Nick Kralevich <nnk@google.com> resolved conflicts for merge of e678897f to klp-dev-plus-aosp

Change-Id: Ie2a5e7a917ab7f5a0ee98300b880d22c7a10bf70
880d1a957ebcb63fb9d3724e2f91c58b7ff0cd54 29-Jul-2013 Robert Craig <rpcraig@tycho.ncsc.mil> Proper security labeling of multi-user data directories.

Add seinfo paramater to appropriate make directory
functions. This allows proper labeling for multi-user
scenarios.

Change-Id: Iaba7c40645bc7b6cc823d613da0c3782acf6ddd5
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.h
abe4fe5b46157ecd2a52d28abf938c816c3ce878 11-Jul-2013 Jeff Sharkey <jsharkey@android.com> Change legacy "persona" references to userid_t.

Offers stronger typing with no functional change.

Change-Id: I09f0262470feec5cfdf26658f998c20550af84d4
/frameworks/native/cmds/installd/installd.h
8b41780d73930b37b6254cc1dac5607c843839c0 02-May-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8768456: Settings > App Info under reports...

...app storage size for apps w/ .so files

The lib directories are tagged with the apk install number,
so must be explicitly passed down to installd.

Change-Id: Iae8815afd6ba964f5b2ed86a0d04a91827391ed6
/frameworks/native/cmds/installd/installd.h
4d3fd4e9988c0eb284dd5104c4dea757f723c716 25-Mar-2013 Robert Craig <rpcraig@tycho.ncsc.mil> Add seinfo parsing to PackageManagerService.

This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory. Modifications
include adjustments to ApplicationInfo.java
to store the seinfo tag per package as well as
adjustments to installd to communicate the seinfo
tag to libselinux.

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.h
a2d838a542c34d2887a0ec1fafa5f47566d595e9 10-Jan-2013 Nick Kralevich <nnk@google.com> Revert "App home directories are now 0700 for targetSdkVersion > 17"

This reverts commit 7f5c84a0b25706746a92ad1233cbbb8923eda54d.

Bug: 7966399
Bug: 7208882
Change-Id: I9fb13cf06c0f6605f3d992525346b14fe3259c66
/frameworks/native/cmds/installd/installd.h
7f5c84a0b25706746a92ad1233cbbb8923eda54d 13-Dec-2012 Nick Kralevich <nnk@google.com> App home directories are now 0700 for targetSdkVersion > 17

Have installd set an app's home directory permissions to
0700 if the app has targetSdkVersion > 17.

Bug: 7208882
Change-Id: Iaa4fc42fec69bc1abdfae53704d6264dd6fa965f
/frameworks/native/cmds/installd/installd.h
f62d2851a83f6976e22932e09c35013a6bb0c3f3 12-Dec-2012 Nick Kralevich <nnk@google.com> remove unused code.

Change-Id: Iacc8b2664a0e404dfa554f223a44126c41581ae4
/frameworks/native/cmds/installd/installd.h
94afecf4b6f437b3ee9a076242402e421c6c07a6 24-Oct-2012 Mike Lockwood <lockwood@google.com> Move non-Java commands over from frameworks/base

Change-Id: I0571813c1cfcf66abd36eb9f178fc49b618e88a6
Signed-off-by: Mike Lockwood <lockwood@google.com>
/frameworks/native/cmds/installd/installd.h