41 Commits

Author SHA1 Message Date
Kenny Root
515087d1c5 Explicitly set lib dir permissions during unlink
The default umask changed, so we have to explicitly set the mode of the
lib directory when we create it in unlinklib.

Bug: 6857022
Change-Id: I06fc3f29e99d686bbbb96184d8c314d4cc57e9fe
2012-07-30 15:01:20 -07:00
Kenny Root
4503cf67b5 Make lib dir before changing ownership of app dir
Bug: 6668897
Change-Id: I8998a50359892277b15e80b5b5590ff94b125467
2012-06-14 15:28:37 -07:00
Dianne Hackborn
d0c5f515c0 Fix issue #6295373: "Package com.google.android.apps.authenticator2 has...
...mismatched uid: X on disk, Y in settings" errors on Froyo and Gingerbread

Deal more gracefully with the uid changing in three ways:

1. If the uid on disk has become root, then have installd change it to
   the application's uid.  This is to correct a potential case where
   installd was interrupted while linking or unlinking the libs dir,
   during which it temporarily changes the owner of the dir to root
   so that a malicious app can not get in its way.  So if the uid on
   disk has become root, we assume we can safely just change it back
   to the correct uid.

2. When scaning packages at boot, use the same "delete and rebuild data
   directory" code for third party applications as we have for system
   applications.  This allows us to at least end up in a state where the
   app will run, even if its data is lost.

3. But we really don't want to get in to case 2, so if an application
   update is being installed and we find that the uid we now have for
   the app is different than the one on disk, fail the update.  This will
   protect against for example a developer changing the sharedUserId of
   their app and getting into this bad state.

Bug: 6295373
Change-Id: Ic802fdd818ac62449ff3c61d1fff1aa4d4942f39
2012-06-07 16:57:57 -07:00
Nick Kralevich
7ac3ed1d76 resist umask changes, make dirs 0711
Make sure /data/user directory permissions get explicitly set
regardless of the system umask.

Change directory permissions to 0711. No need for read permissions.

Bug: 3272072
Change-Id: Ida7f3c6656f4e0c9d0a9f7648491cc853c4e44ca
2012-03-23 18:00:47 -07:00
Amith Yamasani
742a671273 Multi-user - 1st major checkin
Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
2012-02-03 12:01:47 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Kenny Root
cfe82181cb am 7f36d421: am 5a7c9176: Merge "Fix free_cache to actually work" into ics-mr1
* commit '7f36d4217269e79f8409c46f12f10464a1f585ea':
  Fix free_cache to actually work
2011-12-01 14:18:58 -08:00
Kenny Root
ad757e9b36 Fix free_cache to actually work
This broke with some other path-related changes, so it was scanning for
/data/*/cache instead of /data/data/*/cache

Also remove redundant call to restat

Bug: 5686310
Change-Id: Id1661f0f1337858fc9ead53c56ab7557f421c591
2011-12-01 09:07:55 -08:00
Steve Block
71f2cf116a Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-10-26 09:57:54 +01:00
Jeff Brown
bd882b1c87 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
Dianne Hackborn
292f8bc9d1 Plumb information from the framework about asec container size.
Change-Id: Ie0ec3cb6d463aefa341a8cbea80be790451ba5e3
2011-06-28 15:02:44 -07:00
Dianne Hackborn
f741e679c4 resolved conflicts for merge of e2aa0490 to master
Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
2011-06-09 17:50:36 -07:00
Dianne Hackborn
5fd2169eab Work on issue #4518815: Compatibility mode introduces compatibility regression...
...for Market App iRunner

There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components.  This addresses everything
I could find.

Unfortunately it does *not* fix this particular app.  I am starting to think this
is just an issue in the app.  This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.

Also a few changes here and there to get rid of $#*&^!! debug logs.

Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
2011-06-08 18:45:43 -07:00
Amith Yamasani
25641ca1ac Merge "Plumbing in PackageManager and installd for multi-user support." 2011-04-19 10:41:20 -07:00
Amith Yamasani
0b285499db Plumbing in PackageManager and installd for multi-user support.
- Create /data/user directory and symlink /data/user/0 -> /data/data for
  backward compatibility
- Create data directories for all packages for new user

- Remove data directories when removing a user

- Create data directories for all users when a package is created

- Clear / Remove data for multiple users

- Fixed a bug in verifying the location of a system app

- pm commands for createUser and removeUser (will be disabled later)

- symlink duplicate lib directories to the original lib directory

Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
2011-04-15 15:15:27 -07:00
Nick Kralevich
f68327e7e2 Make installd resistant to umask changes.
Bug: 3272072
Change-Id: Ic2d241afcb4d0dabd63fcdadf13b2d48b7f398e8
2011-04-14 16:20:03 -07:00
Kenny Root
86c9584559 Update installd to allow multiuser
* Add ability to select different personas to generate the path to be
  created.

* Move hardcoded paths to read from init's set environment.

* Add unit tests for all the utility functions that build strings to
  make sure they're correct.

* Fill in persona with "0" all the time now. Will be plumbed through in
  later CL.

Change-Id: I0a7f6e3640cb6b052f8823080886ee79e90b679f
2011-04-05 10:45:35 -07:00
Kenny Root
35ab3ad61f Remove defunct secure FS work
Bug: 3365047
Change-Id: I68eaea295881f5431907e1b93bdd73e644e84aa5
2011-02-02 16:42:18 -08:00
Kenny Root
33b2264ea9 Move disk usage utilities to its own library
Disk usage calculation will happen in more places now, so move the
installd calculation utilities out to its own library that only gets
built for the target.

Change-Id: Idceb6bd663ca6ab3d38fa00e57ee74a25b784855
2010-11-30 16:51:13 -08:00
Kenny Root
0332d1c5a5 Exit immediately on some linklib failures
If the library couldn't be printed to the string, installd should fail
early instead of trying to chmod() back to uninitialized stat struct.

Bug: 3121721
Change-Id: I8a3604954ae657a1e07c1ad8d5569aa80aff9e0a
2010-10-21 16:14:06 -07:00
Kenny Root
6a6b007c77 Symlink application lib directory when on SD card
This will help legacy games that use dlopen() to directly access the
/data/data/<app>/lib directory before the
ApplicationInfo.nativeLibraryDir was part of the API.

Change-Id: Ie9f3e7239b6334708b5d086ffafe66a507f6d9da
2010-10-07 17:20:26 -07:00
Kenny Root
3e319a9962 Allow installd to handle large partitions
Use int64_t because we're RPCing over to Java which uses a Long to
represent the filesystem space.

Change-Id: I842b2cf9f2ff8f980ff5895c1c8eb9ebefa1ea31
2010-09-07 14:35:47 -07:00
Kenny Root
508715259c Add more debugging to installd
If a command to installd fails, it would be nice to know exactly why.
Log failures and the errno associated with the failures.

Change-Id: Ia3122675f243037c556d3a49d06da7e03b8c59f6
2010-08-04 13:15:12 -07:00
Suchi Amalapurapu
8a9ab24a5c Do storage checks before initiating a move.
Add new remote method to check for insufficient error conditions.
Some fixes in MountService when updating media status on PackageManagerService
Fix size calculation condition in installd.

Add new error code if media is unavailable.
New tests for testing error codes.
Some additional debugging statements in MountService.

Change-Id: Ibfe90d5ed6c71d57f9c1c67806f38b5ae9ecdfbf
2010-03-16 16:36:26 -07:00
Suchi Amalapurapu
089262dc02 Dont include code size for apps on sdcard.
Use constants defined in PackageHelper for user preferences
to install auto, internal, external.
Set default install location to external.
Update settings db version number

Change-Id: Ib5110c9377990e20a48cee923e55898dfddfd1e6
2010-03-10 16:08:51 -08:00
Dianne Hackborn
c1552397be Allow multiple original-package tags.
Also fix some issues with moving files from update commands.
2010-03-03 16:26:26 -08:00
Oscar Montemayor
8fe5c9e39d Replacing hard-coded mount point for ASEC with a getenv() call. 2010-02-25 00:06:41 -08:00
Suchi Amalapurapu
cf6eaeaae9 Some framework fixes for apps on sd
change hard coded path in installd
fix tests
Work around for renaming containers.
Do forced unmount when destroying containers.
Force a gc in default container service to release handle to parsed package
and thus avoid getting killed by vold
Some cosmetic changes to PackageManager api.
Unit tests for renaming container for MountService
Remove internal size limit on app to be installed.
2010-02-24 11:31:36 -08:00
Dianne Hackborn
d705fd2b0a Tweak updatecmds to be able to move entire directories. 2010-02-12 16:29:50 -08:00
David 'Digit' Turner
0dd50e6126 Fix installd to create /data/data/<pkgname> with appropriate permissions.
The directory was created with read+exec rights for others.
The patch restricts it to only exec rights.
2010-02-09 19:02:38 -08:00
Dianne Hackborn
b858dfda50 Implement system data migration support.
This adds three new features:

- <original-package android:name="com.foo" /> manifest tag.
  This allows an .apk to specify another package it originally came from,
  propagating all state and data from the old to new package.

- <adopt-permissions android:name="com.foo" /> manifest tag.
  In some more complicated cases, a new .apk may be a combination
  of multiple older .apks that each declared their own permissions.
  This allows you to propagate the permissions from these other
  .apks into the new one.

- A new system/etc/updatecmds directory.
  You can place files here which describe data files to move from
  one package to another.  (See below for details.)

Also in this change: we now clean up the data directories of
.apks that disappear from the system image, and some improvements
to logging and reporting error messages.

A typical file in the updatecmds directory looks like this:

-------
com.google.android.gsf:com.google.android.providers.talk
    databases/talk.db
com.google.android.gsf:com.google.android.googleapps
    databases/gls.db
-------

This says that for com.google.android.sfs, there are two packages to
move files from:

From com.google.android.providers.talk, the file databases/talk.db.
From com.google.android.googleapps, the file databases/gls.db

As part of moving the file, its owner will be changed from the old
package to whoever is the owner of the new package's data directory.

If those two files had existed, after booting you would now have the
files:

/data/data/com.google.android.gsf/databases/talk.db
/data/data/com.google.android.gsf/databases/gls.db

Note that all three of these facilities assume that the older .apk
is completely removed from the newer system.  The WILL NOT work
correctly if the older .apk still remains.
2010-02-03 15:42:02 -08:00
Suchi Amalapurapu
c028be4f3b AppsOnSd feature - Add default container
Add new remote interface to do temporary copies. The new
remote stub handling is done on mHandler thread and doesn't need locking
for now.
Add new InstallArgs class and subclasses to isolate cases for installation.
Move resource deletion for failed installs/upgrades to later on in installation
cycle.
Fix code path for forward locked apps when using scanPackageLI

TODO's
Fix installation paths to completely use InstallArgs based design later on.
Get rid of using flags in various install/uninstall code paths.
Ideally InstallArgs should be created using these flags and used in the
rest of the code.
Function renames.
Revisit mount api's.
2010-01-27 10:26:43 -08:00
Suchi Amalapurapu
af8e9f4805 app install on sdcard. provide skeleton implementation
to install an app on sdcard, just resources.
Add new install path for /asec in installd.
ignore . when checking for apk path since the sdcard packages id'ed
by package name.
Add new -s option to adb shell pm
Refactor fwd locked from scanMode to ApplicationInfo.
Add new flag for sd install
Add new parse flags for fwd locking and installing on sdcard
New mock api's in PackageManagerService to invoke MountService api's. These
will be refactored again and so have been wrapped internally.
Some error codes in PackageManager
Changes in PackageManagerService to use mPath and mScanPath during installation
and switch to using PackageParser.Package.applicationInfo attributes for
source and public resource directories.
Some known issues that will be addressed later
 using system_uid for now. needs some tinkering with uid and packagesetting creation to use the actual app uid
 error handling from vold not very robust. ignoring lot of things for now
 sending a delayed destroy to delete packages. will revisit later
 revisit temp file creation later. just copy for now
2010-01-14 14:02:39 -08:00
Oscar Montemayor
a8529f6867 Encrypted File Systems Project. Installer modifications.
Started to modify isntaller for data redirection to a secure location.
2009-11-24 11:44:19 -08:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
d24b8183b9 auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
f1e484acb5 auto import from //branches/cupcake/...@127436 2009-01-22 00:13:42 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00