171 Commits

Author SHA1 Message Date
Dianne Hackborn
4428e17c5e Some clean up of app install and user management.
UserManagerService is now closely tied to PackageManagerService,
sharing the same locks.  There is no longer direct access of
Installer by UserManagerService, instead the package manager is
back to solely owning it.

Creating a new user now correctly only installs system apps for
that user.

Fixed some misc bugs, where we were getting nulls when
querying content providers and instrumentation in uninstalled
users, incorrect locking, etc.

Change-Id: Ife69b6e373d0cf7c5cfc03fc588e36b43ad5d8b0
2012-08-24 18:00:37 -07:00
Dianne Hackborn
7767eac323 Keep track of whether an app is installed for each user.
This add a new per-user state for an app, indicating whether
it is installed for that user.

All system apps are always installed for all users (we still
use disable to "uninstall" them).

Now when you call into the package manager to install an app,
it will only install the app for that user unless you supply
a flag saying to install for all users.  Only being installed
for the user is just the normal install state, but all other
users have marked in their state for that app that it is not
installed.

When you call the package manager APIs for information about
apps, uninstalled apps are treated as really being not visible
(somewhat more-so than disabled apps), unless you use the
GET_UNINSTALLED_PACKAGES flag.

If another user calls to install an app that is already installed,
just not for them, then the normal install process takes place
but in addition that user's installed state is toggled on.

The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED,
PACKAGE_REPLACED etc broadcasts to users who don't have a package
installed or not being involved in a change in the install state.
There are a few things that are not quite right with this -- for
example if you go through a full install (with a new apk) of an
app for one user who doesn't have it already installed, you will
still get the PACKAGED_REPLACED messages even though this is
technically the first install for your user.  I'm not sure how
much of an issue this is.

When you call the existing API to uninstall an app, this toggles
the installed state of the app for that user to be off.  Only if
that is the last user user that has the app uinstalled will it
actually be removed from the device.  Again there is a new flag
you can pass in to force the app to be uninstalled for all users.

Also fixed issues with cleaning external storage of apps, which
was not dealing with multiple users.  We now keep track of cleaning
each user for each package.

Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
2012-08-24 13:53:13 -07:00
rich cannings
d9ef3e5495 Allow verifiers to extend timeout
Create a new verifier API to extend the timeout for a giving package,
including the resulting action (allow or deny) upon the timeout occuring.

Bug: 6901038
Change-Id: I351f7944327f863aff1d7dd1227be74652fa1511
2012-08-23 15:39:02 -07:00
Amith Yamasani
2c1dfa29b4 Merge "Fix deadlock in removing a user" into jb-mr1-dev 2012-08-22 18:19:20 -07:00
Amith Yamasani
0cd867c83e Fix deadlock in removing a user
Cleanup PackageManager settings after the package directories are removed.

Change-Id: I264bc95ea21da653a234d7c81df5b25d4de7aa9e
2012-08-22 16:45:47 -07:00
Amith Yamasani
1952637425 Remove permission requirement for some UserManager calls
Update javadocs to be explicit about permissions.
Minor fixes in UserManagerService

Change-Id: I0d355e0a60e5dbdb49ed06091111d480ff249f3d
2012-08-22 10:28:56 -07:00
Dianne Hackborn
0c38049502 Improve multi-user app management.
Introduce API to get per-user storage information, keep track
of services associated with users, and various small cleanup.

Change-Id: I5d4e784e7ff3cccfed627d66a090d2f464202634
2012-08-21 10:34:20 -07:00
rich cannings
706e8ba26b Pass URLs to package verifiers
This change passes the originating URL and accompanied referrer to
package verifiers, when available.

Bug: 6544677
Change-Id: I9ebc71bc13f549bd88267e444816151a99bda000
2012-08-20 13:20:14 -07:00
Amith Yamasani
fc6e0ca07e Fix build part 2
Change-Id: I3b4ed430f214468a22d3b3aaf3605e570cfd0ed1
2012-08-17 17:07:14 -07:00
Amith Yamasani
a3f133afe8 Save preferred activity info with user id.
So each user can have their own set of intent resolution preferences.

ResolverActivity now launches the activity on the correct user, and
persists the preference for the correct user.

Bug: 6961905
Change-Id: I6d3a8a9af89bc649277d4fc8d0f367ee123f8392
2012-08-17 13:32:02 -07:00
Amith Yamasani
2a00329c6d UserHandle to UserSerialNo mapping
Use AtomicFile for usermanager files.

Added a MANAGE_USERS permission that apps (signature permission) can use
to create/query/modify/remove users.

Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
2012-08-17 09:06:10 -07:00
Kenny Root
9a994b5350 am 050c87f8: am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit '050c87f87e2a48c7bc90f5b15fb6e4e37e667286':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:43:20 -07:00
Kenny Root
050c87f87e am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit 'a950daf5c14a0009c2c62e9c3e0e8d51eb0cf7d9':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:33:40 -07:00
Kenny Root
520ee7bcad am a2e8365c: am 9b0da58e: Merge "Introduce a restorecon JNI binding."
* commit 'a2e8365cc883de0d3e56e9f4af350ecfe1b8fc4c':
  Introduce a restorecon JNI binding.
2012-08-16 15:32:52 -07:00
Kenny Root
a2e8365cc8 am 9b0da58e: Merge "Introduce a restorecon JNI binding."
* commit '9b0da58e3a30b760de37138cdd51d20f269c383e':
  Introduce a restorecon JNI binding.
2012-08-16 15:29:41 -07:00
Kenny Root
786cbcacd2 Use Libcore.os.stat instead of FileUtils
PackageManagerService just needed to know the owner for this file, so
just use stat instead so we can remove the old JNI code.

This is the last user of FileUtils#getPermissions so just remove the
FileUtils method as well.

Change-Id: I953057cd6b9de4410f33b6f22e4bddff02fe2988
2012-08-16 15:27:55 -07:00
Dianne Hackborn
f02b60aa4f Rename UserId to UserHandle.
This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-16 12:46:38 -07:00
Kenny Root
38cc2a5a3a am 3221bf27: am 438a0efc: Do not eject internal ASECs when storage unmounted
* commit '3221bf27ff6b8eebf360ed2496ad5c56b95fd689':
  Do not eject internal ASECs when storage unmounted
2012-08-13 11:42:20 -07:00
Kenny Root
3221bf27ff am 438a0efc: Do not eject internal ASECs when storage unmounted
* commit '438a0efcfbee5dc953e8e5bbdf4cb3dbe94b3f80':
  Do not eject internal ASECs when storage unmounted
2012-08-13 11:40:10 -07:00
Kenny Root
438a0efcfb Do not eject internal ASECs when storage unmounted
If the incoming request is to notify of storage unmounted, don't mess
with apps that are in internal ASECs.

Bug: 6948035
Change-Id: I63ffb895c4d994ee03a5a9bd6bb23f69c88e2a87
2012-08-13 10:51:09 -07:00
Amith Yamasani
258848d2ae User Manager service to manage users and query user details
Moved a bunch of methods from PackageManager to UserManager.

Fix launching of activities from recents to correct user.

Guest creation APIs

Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
2012-08-11 18:24:07 -07:00
Rich Cannings
e1d7c711df Revert "Pass URLs to package verifiers"
This reverts commit 24713907fe4632d263aea82f7a35c8fb08918a09

Change-Id: Ie04ba73475b813635c4a74915c45e83250801b6b
2012-08-08 12:46:06 -07:00
rich cannings
24713907fe Pass URLs to package verifiers
This change passes the originating URL and accompanied referrer to
package verifiers, when available.

Bug: 6544677
Change-Id: If9ff6663ad7f3426b7aea2aceb1413b689788138
2012-08-02 11:26:47 -07:00
Dianne Hackborn
9ec6cdde9f Optimize memory use of IntentResolver.
Use raw arrays instead of ArrayList for data structures.

Temporarily includes a copy of the old intent resolver for
validating the new implementation.

Change-Id: I988925669b6686ac73b779be6cd6fe3a9fd86660
2012-07-30 17:31:19 -07:00
rpcraig
554cb0c290 Introduce a restorecon JNI binding.
Label the vmdl.*\.tmp files and the final .apk file differently.
Modify the WallpaperManagerService to restorecon the wallpaper file.

Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>

Change-Id: Idfc056e9ec0508d7e11100626a7114f341f1af70
2012-07-25 11:07:39 -04:00
Jaikumar Ganesh
1abb1cb3a8 Changes to Bluetooth Service structure.
Changes to make Bluetooth Service part of the system_service.
These changes may be temporary.

Changes to update to the new disable API.

Change-Id: If89dba17e6e6c6daa53c37684221763a2da076e9

Conflicts:

	services/java/com/android/server/pm/PackageManagerService.java
2012-07-13 22:22:51 -07:00
Dianne Hackborn
c32e190ea6 resolved conflicts for merge of a9c38461 to master
Change-Id: Ie7044c4f9f15384c3edd328fa8e2932c731d9d5c
2012-06-29 16:23:49 -07:00
Dianne Hackborn
a9c3846194 am bfb752f8: Merge "Fix issue #6761130: Clearing app data in settings does not clear app\'s USB storage" into jb-dev
* commit 'bfb752f8f0e4d73dc251c19d2ef79649fbbe4fd1':
  Fix issue #6761130: Clearing app data in settings does not clear app's USB storage
2012-06-29 15:43:37 -07:00
Dianne Hackborn
183ce028f1 Fix issue #6761130: Clearing app data in settings does not clear app's USB storage
The package manager calls to clear data / clear cache were not also
having default container service clear the data on external storage.  Now
they do.

Change-Id: Ib5e5eb6adf2cac5a4cc094cc1a02ac8cfb6a2edf
2012-06-29 15:00:21 -07:00
Kenny Root
25a525411b am 7d33d0c3: am c17f92ce: Merge "Use removePackageLI instead of removing mPackages" into jb-dev
* commit '7d33d0c36c7e8c9de4139af383f7491823055bc7':
  Use removePackageLI instead of removing mPackages
2012-06-26 10:39:24 -07:00
Kenny Root
7d33d0c36c am c17f92ce: Merge "Use removePackageLI instead of removing mPackages" into jb-dev
* commit 'c17f92ce047e8d62fac829d1df5dae654f7e4de8':
  Use removePackageLI instead of removing mPackages
2012-06-26 10:36:54 -07:00
Kenny Root
eca64b3914 Use removePackageLI instead of removing mPackages
When adding an system app via OTA, trying to remove it from mPackages
directly doesn't work. The ContentProviders and other things aren't
removed and point to the hidden system app's applicationInfo instead of
the updated app.

Bug: 6685263
Change-Id: I487cf518e0e3c60fae736e9b974617023a7dee8d
2012-06-25 16:39:45 -07:00
Jeff Brown
4f8ecd8029 Move power manager to a new package.
Change-Id: I5f5a6435e64354b7d6535e8e9a63934ba7a3f448
2012-06-18 19:43:44 -07:00
Dianne Hackborn
04919812d6 am 56b3a321: am 1991850d: Merge "Implement issue #6680894: Provide a way to configure app defaults..." into jb-dev
* commit '56b3a321e7c6f03d1bc0c5c0915d56bc46b7a33e':
  Implement issue #6680894: Provide a way to configure app defaults...
2012-06-18 16:24:03 -07:00
Dianne Hackborn
56b3a321e7 am 1991850d: Merge "Implement issue #6680894: Provide a way to configure app defaults..." into jb-dev
* commit '1991850de7bbcc534c2cb457f33055c533542136':
  Implement issue #6680894: Provide a way to configure app defaults...
2012-06-18 16:21:43 -07:00
Dianne Hackborn
fc8b7fe026 Implement issue #6680894: Provide a way to configure app defaults...
...for a smoother OOB experience

Way provided.

Put your defaults in system/etc/preferred-apps/*.xml.

Figure out what to put there with "adb shell dumpsys package preferred-xml".

Bug: 6680894
Change-Id: Ia06bb0061876274a5f80bf06d1ba5ad155edc323
2012-06-18 15:38:12 -07:00
Amith Yamasani
5bb87cd9b8 SearchManagerService made multi-user aware
Cache Searchables per user and query package manager through the
private interface.

Change-Id: I1d24fdd27cce8c27be45287cbfcb4df1e2ce2cf1
2012-06-15 10:24:47 -07:00
Jeff Sharkey
554259fe02 am 9eabf916: am f6f7f1d2: Low disk space string change, surface state.
* commit '9eabf916dc5d53bc6c765d39cca0847993e73dcf':
  Low disk space string change, surface state.
2012-06-12 18:40:24 -07:00
Jeff Sharkey
9eabf916dc am f6f7f1d2: Low disk space string change, surface state.
* commit 'f6f7f1d2dc6e8fad5d6ff9a56af9929488873b4f':
  Low disk space string change, surface state.
2012-06-12 18:36:07 -07:00
Amith Yamasani
b8151ecd6e Add an icon to the user information.
Store the icon in the user folder under /data/system,
similar to how the wallpaper is stored.

Change-Id: Id8ccb55b9e2ba7b4c557505a7f69f04eca1518cf
2012-06-12 18:18:29 -07:00
Jeff Sharkey
f6f7f1d2dc Low disk space string change, surface state.
Surface current low disk state through IPackageManager for use in
Settings app.

Bug: 6576409
Change-Id: I9ae9ce99a2faa3015a237036c03567d1ae11628f
2012-06-12 17:12:08 -07:00
Jean-Baptiste Queru
ca3148edf1 am 6e85ad7d: resolved conflicts for merge of 80d21f2f to jb-dev-plus-aosp
* commit '6e85ad7d267f47ba3a367651a70d147725dc26ae':
  Avoid memory leak in the Shutdown confirmation dialog.
2012-06-11 12:24:54 -07:00
Jean-Baptiste Queru
6e85ad7d26 resolved conflicts for merge of 80d21f2f to jb-dev-plus-aosp
Change-Id: I44b2ba647fb3b208119d10aed3fa6fc85dddfb0d
2012-06-11 12:20:36 -07:00
Dianne Hackborn
c7e2d4a57b am 33e39aef: am 0876ab0a: Merge "Fix issue #6295373: "Package com.google.android.apps.authenticator2 has..." into jb-dev
* commit '33e39aefdf9266dc4858f7a6171f46f43ffa3ec3':
  Fix issue #6295373: "Package com.google.android.apps.authenticator2 has...
2012-06-08 11:12:27 -07:00
Dianne Hackborn
33e39aefdf am 0876ab0a: Merge "Fix issue #6295373: "Package com.google.android.apps.authenticator2 has..." into jb-dev
* commit '0876ab0ac17518c479e9dffe025884870a586d9c':
  Fix issue #6295373: "Package com.google.android.apps.authenticator2 has...
2012-06-08 11:04:13 -07:00
Dianne Hackborn
0876ab0ac1 Merge "Fix issue #6295373: "Package com.google.android.apps.authenticator2 has..." into jb-dev 2012-06-08 11:01:42 -07:00
Kenny Root
f8dc339a52 am 625b92fc: am f27f2f8f: Merge "Delete old forward-locked apps on upgrade" into jb-dev
* commit '625b92fcf7ce3237eb4894e3c41846a65022831d':
  Delete old forward-locked apps on upgrade
2012-06-08 09:23:33 -07:00
Kenny Root
625b92fcf7 am f27f2f8f: Merge "Delete old forward-locked apps on upgrade" into jb-dev
* commit 'f27f2f8f71f584471fe558845c24121e957b2cf2':
  Delete old forward-locked apps on upgrade
2012-06-08 09:19:08 -07:00
Kenny Root
f27f2f8f71 Merge "Delete old forward-locked apps on upgrade" into jb-dev 2012-06-08 09:16:40 -07:00
Kenny Root
987ad95821 am 6dd3a0d6: am 87353093: Merge "Measure ASECs for forward-locked apps" into jb-dev
* commit '6dd3a0d61f707e7f5a9338113217eadac1849e48':
  Measure ASECs for forward-locked apps
2012-06-07 17:21:39 -07:00