History log of /frameworks/base/services/java/com/android/server/pm/UserManagerService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bc9625059bccc8f0d70540d0affd73320620c3c0 15-Nov-2012 Amith Yamasani <yamasani@google.com> Make sure that the owner user is marked initialized.

This is required for upgrades from previous versions of JB.

Bug: 7547639
Change-Id: I21de14a70d6ba2ab21437b5f0721321df45226d2
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
ffe0cb49d14d9c21b5609de009f7e7434e5b0753 06-Nov-2012 Jeff Sharkey <jsharkey@android.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
6f34b411144a8202c96d05ff79e8040d3885643a 23-Oct-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
db6a14cc85cede0769735fdac4da70766989a3ce 18-Oct-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
1638931166b7b5571886a8fe6d413ea90d4194b5 18-Oct-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
756901d82b41f50610a63b7cf4c7747a70f1f724 12-Oct-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
634cf31345ae843392215237e741d76271a5cfed 05-Oct-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1 28-Sep-2012 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
920ace0bbc2d4133dbec991d2636c99a57d6245e 21-Sep-2012 Amith Yamasani <yamasani@google.com> Query users excluding any being removed

Keep track of user creation and last logged-in time.
adb shell dumpsys users
User switcher shouldn't show users about to be removed.
No need to check for singleton for activities.

Bug: 7194894
Change-Id: Ic9a59ea5bd544920479e191d1a1e8a77f8b6ddcf
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
27bd34d9d9fe99f11b80aa0bbdb402fb47ef4158 16-Sep-2012 Jeff Sharkey <jsharkey@android.com> Multi-user MTP.

The current MTP kernel driver at /dev/mtp_usb is exclusive, meaning
only one process can have it open. In addition, each MTP session
with a desktop requires unique object IDs, which doesn't hold true
across users on the device.

To solve these two issues, when switching users we cycle the USB host
stack to disconnect both local and remote MTP connections, giving the
new user's media process a chance to claim /dev/mtp_usb, and causing
the desktop to initiate a new MTP session.

This change also allows BroadcastReceivers to registerReceiver()
allow retrieval of a current sticky broadcast. Adds a system property
to override maximum users. Removes MOUNTED broadcasts for secondary
users. Allows INTERACT_ACROSS_USERS to getCurrentUser().

Bug: 6925114
Change-Id: I02b4a1b535af95fb2142655887b6d15a8068d18a
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
e928d7d95dbb64627e6ff3a0572190c555b59d96 18-Sep-2012 Amith Yamasani <yamasani@google.com> Pass Bitmap instead of ParcelFileDescriptor in UserManager

Add a USER_INFO_CHANGED intent for lockscreen and quicksettings to use
to monitor changes to the user name or icon.

Bug: 7164040
Change-Id: Id6fb8b6d38ce04ccd02bbadcf0c10699783d6c03
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
1d31d5ba129007fc13bd0ed49a3e3cd60e748e7c 17-Sep-2012 Amith Yamasani <yamasani@google.com> Merge "Start userId from 10, reserving 1-9 for special use in the future." into jb-mr1-dev
07a0ede729f9b2f472b659b67b4cbc3602aa289a 17-Sep-2012 Amith Yamasani <yamasani@google.com> Start userId from 10, reserving 1-9 for special use in the future.

Change-Id: I3d0c1717d8b3add75ba43ed98e53ba02e6682c34
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
3b49f07a452e0a77c1d22db2065255689a461d31 17-Sep-2012 Amith Yamasani <yamasani@google.com> Add UserManager.getUserIcon()

So that we don't abuse the setUserIcon() for reading. So the new method won't try
to create the file, only return it if it exists.

Change-Id: I7a81d3f1b29d14d37e71f531744ce39f21d827ac
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
5dc5a00e7ebadc085ded7e29feacd17e53698486 16-Sep-2012 Dianne Hackborn <hackbod@google.com> More multi-user stuff.

- New public APIs to find out when a user goes to the foreground,
background, and is first initializing.
- New activity manager callback to be involved in the user switch
process, allowing other services to let it know when it is safe
to stop freezing the screen.
- Wallpaper service now implements this to handle its user switch,
telling the activity manager when it is done. (Currently this is
only handling the old wallpaper going away, we need a little more
work to correctly wait for the new wallpaper to get added.)
- Lock screen now implements the callback to do its user switch. It
also now locks itself when this happens, instead of relying on
some other entity making sure it is locked.
- Pre-boot broadcasts now go to all users.
- WallpaperManager now has an API to find out if a named wallpaper is
in use by any users.

Change-Id: I27877aef1d82126c0a1428c3d1861619ee5f8653
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
faea76ff8bc9a350765873af81334afe4d14afbd 11-Sep-2012 Amith Yamasani <yamasani@google.com> Enforce a user limit

By default only 1 user is allowed. Some devices permit more than 1.
Set the real user limit in a device overlay for config.xml

Change-Id: I2e0bffa13393b954fcd20e55b92f20de980c58c0
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
1676c856d61b97c871dc2be0cb1f1fb1e12e24e9 10-Sep-2012 Dianne Hackborn <hackbod@google.com> Flesh out multi-user in am commands.

Now we default to the current user instead of user 0 for most commands
(except where we can do the command for all users).

Many more commands take a user argument: force-stop, kill, profile,
dumpheap.

Improved help text.

Change-Id: I719a13b4d31b668f57ca21e51d7043ac3e0d4e1b
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
61f57379ca2c5b6290c8da7548fa17128f7ab24f 31-Aug-2012 Amith Yamasani <yamasani@google.com> Centralize the creation of the user system directory

Environment.getUserSystemDirectory(int userId)

Use it all relevant places that was hardcoding it.
Also, wipe out the user's system directory when user is removed, otherwise old state
might be transferred to a new user.

Change-Id: I788ce9c4cf9624229e65efa7047bc0c019ccef0a
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
5ac72a29593ab9a20337a2225df52bdf4754be02 30-Aug-2012 Dianne Hackborn <hackbod@google.com> Improve multi-user broadcasts.

You can now use ALL and CURRENT when sending broadcasts, to specify
where the broadcast goes.

Sticky broadcasts are now correctly separated per user, and registered
receivers are filtered based on the requested target user.

New Context APIs for more kinds of sending broadcasts as users.

Updating a bunch of system code that sends broadcasts to explicitly
specify which user the broadcast goes to.

Made a single version of the code for interpreting the requested
target user ID that all entries to activity manager (start activity,
send broadcast, start service) use.

Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
80a4af2bbc6af42ae605e454bf89558e564f5244 28-Aug-2012 Dianne Hackborn <hackbod@google.com> Start implementing concept of "running" users.

The activity manager now keeps track of which users are running.

Initially, only user 0 is running.

When you switch to another user, that user is started so it is
running. It is only at this point that BOOT_COMPLETED is sent
for that user and it is allowed to execute anything.

You can stop any user except user 0, which brings it back to the
same state as when you first boot the device. This is also used
to be able to more cleaning delete a user, by first stopping it
before removing its data.

There is a new broadcast ACTION_USER_STOPPED sent when a user is
stopped; system services need to handle this like they currently
handle ACTION_PACKAGE_RESTARTED when individual packages are
restarted.

Change-Id: I89adbd7cbaf4a0bb72ea201385f93477f40a4119
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
4428e17c5e05c0dad76da8f1c28ccba62a66cd91 25-Aug-2012 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
7767eac3232ba2fb9828766813cdb481d6a97584 24-Aug-2012 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
2c1dfa29b40a988e3ea8f6922768465743aafddc 23-Aug-2012 Amith Yamasani <yamasani@google.com> Merge "Fix deadlock in removing a user" into jb-mr1-dev
0cd867c83e726c88355375af4d14ee83f3339bbe 23-Aug-2012 Amith Yamasani <yamasani@google.com> Fix deadlock in removing a user

Cleanup PackageManager settings after the package directories are removed.

Change-Id: I264bc95ea21da653a234d7c81df5b25d4de7aa9e
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
1952637425eece18aa1ce3d80d4b49086ef3bcf7 22-Aug-2012 Amith Yamasani <yamasani@google.com> Remove permission requirement for some UserManager calls

Update javadocs to be explicit about permissions.
Minor fixes in UserManagerService

Change-Id: I0d355e0a60e5dbdb49ed06091111d480ff249f3d
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
fc6e0ca07e599de5229582efe29c4f78eabaa3b8 18-Aug-2012 Amith Yamasani <yamasani@google.com> Fix build part 2

Change-Id: I3b4ed430f214468a22d3b3aaf3605e570cfd0ed1
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
a3f133afe885f9e005dfc0584cb7b3b90f75f665 10-Aug-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
2a00329c6d55c6cd9166e01963d7410e95d80d21 15-Aug-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java
258848d2ae04f447ff1c18023fa76b139fcc0862 11-Aug-2012 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/services/java/com/android/server/pm/UserManagerService.java