290 Commits

Author SHA1 Message Date
Dianne Hackborn
d4d9364019 Maybe fix build.
Change-Id: Ibad8edb15e7cc332d6c29958a386d32a96f4e755
2013-01-29 16:12:48 -08:00
Dianne Hackborn
8a2ed1d7c0 Improve configuration of default preferred apps.
The file that defines default preferred apps is now more
robust.  It is no longer a raw dump of the package
manager settings, but instead a more general list of a
target activity and filter.  When reading it, the remaining
information (match value, set of potential matches) is
determined dynamically.

Change-Id: I0edc6e0d2ed3dd2a6e2238992f18f7fc1f51d8d4
2013-01-29 15:18:29 -08:00
Dianne Hackborn
5e45ee6752 App ops: you can now turn off operations.
Also add new ops for calendar and wi-fi scans, finish
implementing rejection of content provider calls, fix
issues with rejecting location calls, fix bug in the
new pm call to retrieve apps with permissions.

Change-Id: I29d9f8600bfbbf6561abf6d491907e2bbf6af417
2013-01-25 11:25:48 -08:00
Dianne Hackborn
51ff575d1b Merge "Fix issue #7649720: ANR occur when OTA with lower version..." 2013-01-23 22:46:01 +00:00
Dianne Hackborn
c4d27a7d55 Fix issue #7649720: ANR occur when OTA with lower version...
...of Play Store is included

The issue is that the name of the play store apk on the system
image has changed, and the package manager has a bug when this
happens and it is being hidden by an updated version of the
application that is still a newer version.  In this case it
doesn't do the normal scan of the system apk, but just leaves
its old disabled state.  However if the code path has changed,
this will trip up other code that thinks the system apk has
disappeared (since when it checks for the existence of the apk
with the stored code path, it doesn't find anything).

The fix here is to add a special case to make sure the code
path is updated even if we are otherwise ignoring the hidden
system image package data.

Change-Id: Ic5118f94c078da7a30b53b9cadf7c9844f7ba866
2013-01-22 18:30:17 -08:00
Dianne Hackborn
fd7adedebf Add new disabled state for "optional" built-in apps.
The disabled state allows you to make an app disabled
except for whatever parts of the system still want to
provide access to them and automatically enable them
if the user want to use it.

Currently the input method manager service is the only
part of the system that supports this, so you can put
an IME in this state and it will generally look disabled
but still be available in the IME list and once selected
switched to the enabled state.

Change-Id: I77f01c70610d82ce9070d4aabbadec8ae2cff2a3
2013-01-22 17:10:23 -08:00
Dianne Hackborn
d8e1dbb6bc Rework ParceledListSlice to be much easier to use.
Take advantage of this to return better information about
packages filtered by permissions -- include the permissions
they have in the requested array.

Also fix issue #8026793 (Contact picture shows default pic
while searching for a contact in qsb) by using the base
package name of the Context when reporting the app name
of an operation.  Otherwise you could make a resource-only
context for another application and do calls through that
and get reported as the wrong app.

Change-Id: I5e0488bf773acea5a3d22f245641828e1a106fb8
2013-01-18 13:02:26 -08:00
Dianne Hackborn
2125dd57cc Merge "AppOps: fix nested op tracking, new API to get apps using permissions." 2013-01-17 02:51:11 +00:00
Dianne Hackborn
e799175b6b AppOps: fix nested op tracking, new API to get apps using
permissions.

Change-Id: I20c7bd58febc01d6911a90440867eaacd133c464
2013-01-16 18:10:40 -08:00
Amith Yamasani
27b89e6658 Rename bindService to bindServiceAsUser to follow convention.
This is for the multi-user version of bindService, not the original.

Change-Id: Ib2de35941196accf387b1a276a77e6f9af805ec0
2013-01-16 12:30:11 -08:00
Nick Kralevich
1506921e8e Revert "App home directories are now 0700 for targetSdkVersion > 17"
This reverts commit 92091fa9636403728fe94cc83400495a8612c2d3.

Bug: 7966399
Bug: 7208882
2013-01-09 15:54:56 -08:00
Nick Kralevich
92091fa963 App home directories are now 0700 for targetSdkVersion > 17
Pass targetSdkVersion to installd so it knows the appropriate
permissions to apply to the app's home directory.

Bug: 7208882
Change-Id: Ia62ed36b32ee5af01077fb10a586024411be8ed4
2012-12-14 11:53:10 -08:00
Nick Kralevich
0490f02eb7 Merge "Remove unused code." 2012-12-12 12:43:36 -08:00
Nick Kralevich
4d254266a4 Remove unused code.
Change-Id: I6785cea91c0ab2c367645201fb8862dbf1a55773
2012-12-12 10:38:40 -08:00
Kenny Root
3f96d0e127 If freeCache deletes APK, give out of space error
After DownloadManager has downloaded an application to cache to install
during low memory condition, we try to free cache to fit the new
application. The free cache function deletes older files first, but it
will also delete the downloaded application (since it's in cache) as a
last resort since installd has no context about it.

This just changes the error code returned in this case so that we'll
give something more meaningful to the user. A later fix should actually
make this more sane. For instance: know which file to avoid deleting,
not even trying to delete anything if it won't arrive at the desired
free space.

Bug: 7684538
Change-Id: Ide77320fc51a4f692ef8042cb0eafe17b5cd279d
2012-12-11 13:35:43 -08:00
Dianne Hackborn
13579ed330 Cleaner initial boot.
This does some cleanup of the initial boot, especially when
booting in "no core apps" mode for encryption/decryption.

Change-Id: Ifb3949f580e52f54559e603c4b0b104f6bac2f6c
2012-11-28 18:09:01 -08:00
Dianne Hackborn
40e9f2922c Quiet down a lot of logging.
Also fix a little problem where the USER_STARTED broadcasts
were not being sent as ordered broadcasts(!).

Change-Id: I3aa3e0a9b3900967cdd2d115ee103371b0a50c41
2012-11-27 19:12:23 -08:00
Amith Yamasani
bc9625059b Make sure that the owner user is marked initialized.
This is required for upgrades from previous versions of JB.

Bug: 7547639
Change-Id: I21de14a70d6ba2ab21437b5f0721321df45226d2
2012-11-15 14:43:13 -08:00
Jeff Sharkey
ffe0cb49d1 Avoid recycling recently removed user IDs.
Currently, installd doesn't correctly evict VFS cache entries for
FUSE emulated external storage.  This means zygote processes have an
inconsistent view of the FUSE daemon when the system rapidly
recycles user IDs.

To work around this, only consider recycling a user ID after its
VFS cache entries have expired.  The emulated storage FUSE daemon
currently uses a 'entry_valid' timeout of 10 seconds.

Bug: 7407902
Change-Id: Id80cbdd2215d8456467fb31e4c209ca12a505e16
2012-11-07 11:30:39 -08:00
Kenny Root
ca60ba1874 Merge "Move app-lib definition up for system app scanning" into jb-mr1-dev 2012-10-29 17:14:51 -07:00
Kenny Root
584c4cdbf3 Move app-lib definition up for system app scanning
System apps were getting the wrong path because app-lib directory was
defined after the scanning of packages.

Bug: 7425516
Change-Id: I7a7a6b2a74f846c84516440ee950099bdc564d0b
2012-10-29 10:46:42 -07:00
Amith Yamasani
f031f230f5 Fix for some downloaded apps showing up on all users
Bug: 7226656

In the case of packages with sharedUserId, the packages were inserted
into mPackages a little later. We were reading the package restrictions
before this happened and so the apps were being removed from the restricted
list, effectively setting installed=true.

Moved the block that reads the restrictions to after the processing of
mPendingPackages.

Also, don't setInstalled for all users in the pending packages processing.

Change-Id: I382787e45fecdb871d80ffb4d854782d8e32e4a7
2012-10-26 17:10:51 -07:00
Amith Yamasani
6f34b41114 Fix the user name for the owner.
Use a version number to update the name to Owner, from Primary.
For new installations, use the correct localized string.

Bug: 7417150

Fix a typo in the permission description.

Bug: 7333304
Change-Id: I123741e581c6a02d4597b3cd81f2ca48a8587e2a
2012-10-26 10:06:22 -07:00
Dave Burke
799916e6ac Merge "Revert "Check non-primary user dirs during package scan"" into jb-mr1-dev 2012-10-23 23:14:15 -07:00
Dave Burke
383fa18b51 Revert "Check non-primary user dirs during package scan"
This reverts commit 4525f5b69cb44a9a0c92f9c525fc47541f456621

Change-Id: I31b7a0860972532478ab3420556b806bfa78739a
2012-10-23 23:12:19 -07:00
Kenny Root
92bc9b3196 PMS: check outInfo for null during delete
It appears that changing an application's signature during boot can pass
an outInfo of null to this function.

Bug: 7402550
Change-Id: I839fea6c8ee728a352c6b906f0fa6671c85f8694
2012-10-23 17:44:26 -07:00
Dianne Hackborn
56e75631bd Merge "Fix issue #7342364: JellyBean broke Toddler Lock, again" into jb-mr1-dev 2012-10-23 17:35:59 -07:00
Dianne Hackborn
77119bc6c9 Fix issue #7342364: JellyBean broke Toddler Lock, again
Change-Id: I400c02711edc302a1bc7fbf98b62fcb9f76e5e12
2012-10-23 15:02:25 -07:00
Kenny Root
4525f5b69c Check non-primary user dirs during package scan
During package scan, only the primary user data directories were
checked. If the secondary user didn't have an application directory, it
would happily ignore it. The app would then crash upon startup.

Bug: 7391882
Change-Id: I1fa92aa27386104d4ac6bc5dc92bfbf2e7dfac9f
2012-10-22 18:48:24 -07:00
Amith Yamasani
8074e98b20 Merge "Fix crashes when quickly adding and removing users" into jb-mr1-dev 2012-10-21 07:44:46 -07:00
Kenny Root
9bef3294d3 Merge changes Ie3c8ca8d,Ia175b36d into jb-mr1-dev
* changes:
  Try to free cache before giving up on install
  Robustly add symlink and add for non-primary users
2012-10-19 16:37:55 -07:00
Amith Yamasani
db6a14cc85 Fix crashes when quickly adding and removing users
Make USER_REMOVED an ordered broadcast and send it before the user's
state is completely removed from the system. This gives services the
opportunity to clean up their state, while still having access to the
user's directory and UserInfo object (such as serial number).

Tell SyncManager to skip over dying/partially created users.

Improve UserManager tests, waiting for users to be removed fully.

Bug: 7382252

Change-Id: I93cfb39c9efe6f15087bf83c569a2d154ef27168
2012-10-19 16:23:30 -07:00
Kenny Root
cea3743499 Try to free cache before giving up on install
Try to get installd to free up cache before giving up when there is too
little space free.

Bug: 7232123
Change-Id: Ie3c8ca8dfc190abbb9a29a7baee31f32e9de7d69
2012-10-18 17:21:59 -07:00
Kenny Root
a3e90798b7 Robustly add symlink and add for non-primary users
Amazingly, some apps still don't use the nativeLibraryPath. So add a lib
symlink for non-primary users to fix that.

Also, there was an error when the symlink existed that it would give up.
This shouldn't really happen, but in that case, just remove it and
create a new one to be safe.

Also, move the downgrade code to the appropriate place. This downgrade
case triggered the above symlink existing bug.

Bug: 7318366
Bug: 7371571
Change-Id: Ia175b36d98f00bdc2f2433b909aafd524eb34d15
2012-10-18 15:12:09 -07:00
Amith Yamasani
1638931166 Allow services to query the info for a dying user.
This allows services watching for USER_REMOVED to fetch the serialNumber of a dying user.

Also fix an AIOOBE when building the userId array, typically on cleanup.

Bug: 7368826
Change-Id: I24e52278af8353b5744372127da4bf4fafc89baa
2012-10-17 21:20:14 -07:00
Amith Yamasani
756901d82b Do cleanup when Stopping users
Mark user 0 as initialized, otherwise it will show up as
uninitialized when viewed from secondary user if never switched to user 0.

Bug: 7301595

Also clean up any users that were in the process of being removed, if device
crashes at a bad time.

Change-Id: Ic16a6c9ccb6a64b7463725f6cc279335a821fcd5
2012-10-15 16:57:26 -07:00
Jeff Sharkey
38f8688bae Return ApplicationInfo with requested userId.
Return ApplicationInfo with requested userId instead of trying to
infer it from calling UID.

Bug: 7334712
Change-Id: I9ce0061e2d020b0d74c7c9cd22d89c5ff2466a6c
2012-10-11 16:10:23 -07:00
rich cannings
36070b414a Fix verfication bypassed for adb installs
ADB installs appear as UserHandle.USER_ALL, and can only be performed by
UserHandle.USER_OWNER, so use the package verifier for UserHandle.USER_OWNER.
This returns a valid userId to call PackageManagerService.getPackageUid.

Bug: 7293091
Change-Id: I7a5497cfe5fa2e7aa804345cf9f507ec26a0db21
2012-10-09 13:34:51 -07:00
Dianne Hackborn
6309271f7b Fix issue #7295951: Mako asks which Launcher to use at every re-boot
A couple problems:

- We need to clear app preferences later, now that we have encrypted apps.
- The multi-user implementation of this would allow different preferred
  apps from different users to potentially interefere with each other.
  They are not completely separate data structures.

Change-Id: Id4f1ebb6414fdf30ff1049adaa1efe83dabac01a
2012-10-07 14:45:35 -07:00
Amith Yamasani
634cf31345 Fix serial number assignment for new user on a freshly wiped device
Bug: 7280093

User serial number was not being bumped up from 0 on a freshly wiped device
due to the userlist not existing. This was resulting in the first 2 users
getting the same serial number, messing up C2DM message delivery. This issue
doesn't show up if you boot the device before adding a user, so it wasn't
discovered earlier.

Change-Id: I8a5d99b9ad2ccfb66a16cacac9548ba53f0be387
2012-10-04 17:34:21 -07:00
rich cannings
cdf932e050 Fix PackageInstaller displays with multi-user
With this fix, when all users cancel installing an app they were warned about,
then the "Installing..." screen disappears, as desired.

Bug: 7255231
Change-Id: I2475fa790a5d09abbf94411c696682502fb1e8df
2012-10-03 14:32:38 -07:00
Dianne Hackborn
5bc54bf354 Merge "Fix issue #7272775: Auto Start Apps Not Starting" into jb-mr1-dev 2012-10-02 16:25:15 -07:00
rich cannings
3ed62adad1 Merge "Fix package verification with multi-user" into jb-mr1-dev 2012-10-02 16:25:15 -07:00
Dianne Hackborn
4a9f071f3d Fix issue #7272775: Auto Start Apps Not Starting
Bad defaults were causing stopped state to be set at each
boot.

Change-Id: I49b04e9c62f6ac391054201b508fddb6c7985615
2012-10-02 15:29:06 -07:00
rich cannings
d55deb0a71 Fix package verification with multi-user
Fixes the porblem of PackageManagerService always sending Intents to user 0.

Bug: 7272549
Change-Id: I25995d8b2b9a24346f4813e6d8d9a84e5d5d2b6b
2012-10-02 14:53:08 -07:00
Jeff Sharkey
6e2bee75ce Migrate more System and Secure settings to Global.
Includes telephony, WindowManager, PackageManager, and debugging
settings.  Update API to point towards moved values.

Bug: 7231764, 7231252, 7231156
Change-Id: I5828747205708872f19f83a5bc821ed0a801cb79
2012-10-02 13:55:15 -07:00
Amith Yamasani
54289b8b4a Fix cache deletion for secondary users
Bug: 7249419

Change-Id: Idbc0f9994508059ebf5055aea961b87e08b3673a
2012-10-01 11:19:55 -07:00
rich cannings
a2064df6ab Disable package verification in test harness
Bug: 7233608
Change-Id: I521980728f5fb68b42a3906ff4fd25cd59dbbd7a
2012-09-30 14:52:41 -07:00
Dianne Hackborn
3ff8e1a800 Merge "Fix issue #7211769 and #7244492, thrash around on #7226656." into jb-mr1-dev 2012-09-28 15:54:44 -07:00
Dianne Hackborn
d4ac8d7b3d Fix issue #7211769 and #7244492, thrash around on #7226656.
Issue #7211769: Crash dialog from background user has non-working "report"

The report button now launches the issue reporter for the correct user.
Also for crashes on background users, either disable the report button,
or simply don't show the dialog depending on the build config.

Issue #7244492: Bugreport button in Quick Settings doesn't actually do anything

Now they do.

Issue #7226656: second user seeing primary user's apps

I haven't had any success at reproducing this.  I have tried to tighten up
the path where we create the user to ensure nothing could cause the
user's applications to be accessed before the user it fully created and thus
make them installed...  but I can't convince myself that is the actual problem.

Also tightened up the user switch code to use forground broadcasts for all
of the updates about the switch (since this is really a foreground operation),
added a facility to have BOOT_COMPELTED broadcasts not get launched for
secondary users and use that on a few key system receivers, fixed some debug
output.

Change-Id: Iadf8f8e4878a86def2e495e9d0dc40c4fb347021
2012-09-28 15:37:22 -07:00