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
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
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
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
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
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
Previously AID_INSTALL was used, which was causing permission denied errors
when PackageManager was trying to recursively rename staging directory
Bug: 19550105
Bug: 20087446
Change-Id: I3a9e3056c1fbc1ce0077a3ce52cf77ea6b5085ee
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
Previously odex files were stored alongside the dex location as:
dex location: /foo/bar/base.apk
odex location: /foo/bar/<isa>/base.odex
This changes where odex files are stored, adding an "oat" directory:
dex location: /foo/bar/base.apk
odex location: /foo/bar/oat/<isa>/base.odex
See also the corresponding changes in platform/art and platform/build.
Bug: 19550105
Change-Id: I4c6be4f0c41ff175904846db8e360c4af815b265
When decrypting a device, a tmpfs is temporarily mounted as /data,
the size of which is usually small. When the zygote, system server
and necessary apps are brought up, they will be compiled into the
tmpfs.
If the system image contains prebuilts, they will be relocated instead
of compiled. This is unnecessary. In this special situation it is
acceptable to run out of the prebuilt oat files without relocation,
which can save space in the tmpfs.
This patch ensures that apps are not being relocated.
Change-Id: I42bfb7e3039574b7e4f2772e0d395f093d59ed1b
Signed-off-by: Hyangseok Chae <neo.chae@lge.com>
Add swap file support for dex2oat to installd. Only use in low-memory
mode.
Bug: 18596910
(cherry picked from commit f68ce4de7f)
Change-Id: I131448f3907115054a592af73db86d2b9257ea33
Mark 2 unused paramters to prevent clang from erroring out
Change-Id: Ifc9b4a5b820bd6318e9259e737e708d25fdb174b
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
This fixes jank caused by dex2oat while installing an application in the
background.
Bug: 17497551
Change-Id: I5a69b00c0fd76ae22a0d1adb242bef6c18a75743
Parser does not take into account that the last argument can be empty.
In this case it will skip end of line marker and continue parsing.
Change-Id: I2d029a69ed22cef497893e592ff3275ced97f85f
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
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
All extra options are provided as one argument to dex2oat.
The patch splits all options to individual ones.
Change-Id: Ied65bb9cf38b114611e88a8d5d86305021700d0b
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>