Commit Graph

796 Commits

Author SHA1 Message Date
Amith Yamasani
16979eab19 Fix build
Merge error...

Change-Id: I0e674ee25a080fa6abfaa9da893084d6b4fa69a6
2012-09-24 18:14:47 -07:00
Amith Yamasani
8d8766bc78 Merge "AppInfo from Notifications for secondary users" into jb-mr1-dev 2012-09-24 17:43:18 -07:00
Amith Yamasani
ea7e91514e AppInfo from Notifications for secondary users
Required wiring up startActivitiesAsUser()

Bug: 7224950

Also fix a bug in navigateUp in secondary user

Change-Id: I114ae2de0457362d62e899fdb94b12239a3eb778
2012-09-24 17:19:03 -07:00
Dianne Hackborn
4c0f678284 Merge "Fix issue #7215984: java.lang.RuntimeException: Unable to create..." into jb-mr1-dev 2012-09-24 15:08:31 -07:00
Martijn Coenen
ed50c00653 Merge "Add NfcBarcode technology API." into jb-mr1-dev 2012-09-24 15:01:20 -07:00
Dianne Hackborn
139748fd72 Fix issue #7215984: java.lang.RuntimeException: Unable to create...
...service com.android.systemui.SystemUIService: java.lang.NullPointerException

- Don't acquire the activity manager lock in handleIncomingUser(),
  there is really no need to do so.
- Rework the settings provider client side cache code to not hold
  locks while calling into the provider.

I also changed the way the settings provider uses system properties
so that there is one property for all users.  We can't do one per
user, since the system property name space is limited with a fixed
size.  And we don't really need to do that; the worse that happens
by combining all users is that if one running user changes one of its
settings, all other running users will think they need to reload
settings when they go to fetch them next.

Change-Id: I13b90b832310d117eb6d721aacd122cfba7d749a
2012-09-24 14:15:14 -07:00
Dianne Hackborn
50cdf7c306 Fix issue #7214090: Need to be able to post notifications to all users
Also fix a bunch of system services that should be doing this.  And
while doing that, found I needed to fix PendingIntent to evaluate
USER_CURRENT at the point of sending, not creation.

Note that this may end up with us having some notification shown to
non-primary users that lead to settings UI that should only be for
the primary user (such as the vpn notification).  I'm not sure what
to do about this, maybe we need a different UI to come up there or
something, but showing the actual notification for those users at
least seems less broken than not telling them at all.

Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
2012-09-24 10:55:46 -07:00
Jeff Sharkey
5c7527ba15 am 8bc3cfa3: am 11820f73: Merge "Allow acquiring ContentProviders across users." into jb-mr1-dev
* commit '8bc3cfa3674217e967b64340bae6f6003f332e66':
  Allow acquiring ContentProviders across users.
2012-09-24 09:38:27 -07:00
Jeff Sharkey
6d51571835 Allow acquiring ContentProviders across users.
Otherwise services like SystemUI will always open content://-style
Uris as USER_OWNER.  Surfaces through createPackageContextAsUser()
which points all ContentResolver operations towards a given user.

Start using in RemoteViews, so that Notifications correctly resolve
image Uris to the sending user.  Also add user support for "content"
shell tool.

Bug: 7202982
Change-Id: I8cb7fb8a812e825bb0b5833799dba87055ff8699
2012-09-21 19:49:43 -07:00
Amith Yamasani
f16c559cff am e6a5c571: am 74defbf2: Merge "Query users excluding any being removed" into jb-mr1-dev
* commit 'e6a5c571c3bb174fe66d2f418070c549bc195c98':
  Query users excluding any being removed
2012-09-20 23:13:21 -07:00
Amith Yamasani
920ace0bbc 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
2012-09-20 22:33:43 -07:00
Dianne Hackborn
febd9cb1af am b79d01ed: am 6de76d21: Merge "Implement multi-user PackageMonitor." into jb-mr1-dev
* commit 'b79d01edb29f1d047ce9adb3e1b90c308ddcb47c':
  Implement multi-user PackageMonitor.
2012-09-20 15:46:29 -07:00
Dianne Hackborn
c72fc674a3 Implement multi-user PackageMonitor.
New APIs let you indicate what user(s) to monitor, and tell you
what user is changing when receiving a callback.

Fix package manager to only deliver package brpadcasts to the
running users.  (This isn't really a change in behavior, since
the activity manager would not deliver to stopped users anyway).
Make sure all broadcasts that package monitor receives also include
user information for it to use.

Update wallpaper service to (hopefully) now Really Correctly
monitor package changes per user.

Change-Id: Idd952dd274abcaeab452277d9160d1ae62919aa0
2012-09-20 14:53:18 -07:00
Dianne Hackborn
4786223a08 am 7788b759: am 52716deb: Merge "Fix deadlock in LockPatternUtils by using local id." into jb-mr1-dev
* commit '7788b759726f4c3c004075ac5c5977f6e4c82fe0':
  Fix deadlock in LockPatternUtils by using local id.
2012-09-19 15:21:35 -07:00
Dianne Hackborn
79c8c7a4ff am 9b4d528d: am 09ad0832: Merge "Switch to showing top-most thumbnail of recent apps." into jb-mr1-dev
* commit '9b4d528d7edf3d55a925b79ab7ba7664a9cb7a5e':
  Switch to showing top-most thumbnail of recent apps.
2012-09-19 15:20:41 -07:00
Dianne Hackborn
52716deb40 Merge "Fix deadlock in LockPatternUtils by using local id." into jb-mr1-dev 2012-09-19 13:28:11 -07:00
Craig Mautner
f1b6741975 Fix deadlock in LockPatternUtils by using local id.
Activity manager now updates window manager's current user id
directly and immediately rather than waiting for a broadcast
update. Window manager passes this through policy to the
KeyguardViewMediator and into LockPatternUtils. LockPatternUtils
no longer goes to Activity to get the current user id if it finds
that its local id is non-default.

Fixes bug 7193726.

Change-Id: Id5613e7a9fe9e5b49e83c26b74504f587c3998c2
2012-09-19 13:18:29 -07:00
Dianne Hackborn
09ad0832e0 Merge "Switch to showing top-most thumbnail of recent apps." into jb-mr1-dev 2012-09-19 11:40:18 -07:00
Dianne Hackborn
15491c6a72 Switch to showing top-most thumbnail of recent apps.
The way it should have been, and with the new recents enter animation
the way it must be.

Added a new method to retrieve this thumbnail, since it would be less
efficient to use the existing API (which always returns the "base"
thumbnail).  Probably at some point that existing API should be tweaked
to always return the top thumbnail instead, but that is for a later time.

Also removed code that would clear the thumbnail associated with an
activity when it is resumed.  I don't think there should ever be a
reason to clear a thumbnail -- it's much better to have *something*
for the task, even if it is a little out of date.

Change-Id: I83e6ca6403eb2df5e4de3009dfe8c210e8cf8d5b
2012-09-19 11:25:40 -07:00
Dianne Hackborn
1cf4289349 am 8f2ec436: am 1e5aeecb: Merge "Don\'t allow more than 3 actively running users at a time." into jb-mr1-dev
* commit '8f2ec4365f518a9752e379ca87e3fcdcd2c4c55f':
  Don't allow more than 3 actively running users at a time.
2012-09-19 05:50:39 -07:00
Dianne Hackborn
1e5aeecb64 Merge "Don't allow more than 3 actively running users at a time." into jb-mr1-dev 2012-09-18 18:22:15 -07:00
Dianne Hackborn
bb1aeff320 Don't allow more than 3 actively running users at a time.
Change-Id: Ic047c62b518a0faaa7b507343909330044ec290b
2012-09-18 18:20:43 -07:00
Jeff Sharkey
3611eacaaa am e339f025: am 6281d7cf: Merge "Multi-user MTP." into jb-mr1-dev
* commit 'e339f025e44558e251ac67fc3f3d5c909264adfc':
  Multi-user MTP.
2012-09-18 15:33:23 -07:00
Jeff Sharkey
27bd34d9d9 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
2012-09-18 13:26:26 -07:00
Dianne Hackborn
03f2abecae am 596115b1: am c535d2f3: Merge "Fix dumb bug merging receivers for multiple users." into jb-mr1-dev
* commit '596115b132c9c84f45088cc3cbd5aba9abe3c678':
  Fix dumb bug merging receivers for multiple users.
2012-09-18 00:10:12 -07:00
Dianne Hackborn
560f555c43 am c0b59093: am 4246f695: Merge "Try again to fix issue #6912004:tap on gmail notification sends me to home screen" into jb-mr1-dev
* commit 'c0b590932d611e842836d1662a4baa4812d07b21':
  Try again to fix issue #6912004:tap on gmail notification sends me to home screen
2012-09-18 00:09:31 -07:00
Dianne Hackborn
c535d2f30e Merge "Fix dumb bug merging receivers for multiple users." into jb-mr1-dev 2012-09-17 18:52:30 -07:00
Dianne Hackborn
6cbd33fc25 Fix dumb bug merging receivers for multiple users.
Also clean up some debug output.

Change-Id: Ib19e47682e9ddfc6a234bd61d054275a362d28cc
2012-09-17 18:43:00 -07:00
Dianne Hackborn
ad9b32115b Try again to fix issue #6912004:tap on gmail notification sends me to home screen
Add a new call to the activity manager to tell it when the activity
is resumed, so it can mark its state as dirty then instead of when
it first tries to create it.

Also tweak things to update the LRU list for the upcoming activity
at the point we start pausing the current activity, to avoid an
inefficiency where we may decide to kill the process of the upcoming
activity if it is at the end of the LRU list.

Change-Id: Ia6dc8c34dc6d4b085a1efbe3a5d5f47721d55078
2012-09-17 16:03:22 -07:00
Dianne Hackborn
9905a8d4bb am 68128325: am 443e4748: Merge "Fix issue #7175553: GRANT_URI_PERMISSION doesn\'t apper to work on secondary user" into jb-mr1-dev
* commit '681283257d6ff4f77a5ca66a0e7ad51c90320db6':
  Fix issue #7175553: GRANT_URI_PERMISSION doesn't apper to work on secondary user
2012-09-17 14:45:54 -07:00
Dianne Hackborn
397c1d8467 am 0fd909ba: am d65afc65: Merge "More multi-user stuff." into jb-mr1-dev
* commit '0fd909bad1151cc39061abb52ae5b8be090e05dd':
  More multi-user stuff.
2012-09-17 14:44:10 -07:00
Dianne Hackborn
11f0cb7d07 Fix issue #7175553: GRANT_URI_PERMISSION doesn't apper to work on secondary user
Change-Id: I0ab372978f8599d0fe8d5da8aeb73965ab85797f
2012-09-16 17:12:34 -07:00
Dianne Hackborn
5dc5a00e7e 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
2012-09-15 23:58:55 -07:00
Kenny Root
df1a9dab51 am 871e27ea: am 24271a8c: Merge "Use shared app gid for forward-locked processes" into jb-mr1-dev
* commit '871e27eabc626dd50191df6c3bb3350214612c9b':
  Use shared app gid for forward-locked processes
2012-09-13 14:48:25 -07:00
Dianne Hackborn
f41d25a2f5 resolved conflicts for merge of 8bb779bd to master
Change-Id: I72ddc0a67cf55d45958a622ffe535f32c1721052
2012-09-12 10:55:03 -07:00
Kenny Root
e091f22e22 Use shared app gid for forward-locked processes
Use a shared app gid for each app across different users which allows
forward-locked applications to share the same APK file.

Change-Id: Ifecf51ee7865547117746f83e9733083d3dd5111
2012-09-11 15:01:26 -07:00
Dianne Hackborn
9d9ece3c1e Animations for user switching.
The window manager now has a facility to provide a full-screen
animation, which the activity manager uses every time a user
switch happens.

The current animation is just a simple dumb slide until we get
a design from UX.

Also some cleanup: moved the portrait task animations to the
default config so we always have an animation for them, and finally
got the java symbol stuff out of public.xml.

Change-Id: I726f77422b2ef5f2d98f961f8da003e045f0ebe8
2012-09-10 19:58:21 -07:00
Dianne Hackborn
3dd94ced96 am 206aa76c: am 4573e29f: Merge "Flesh out multi-user in am commands." into jb-mr1-dev
* commit '206aa76cdce6bc9697833f4657e7fc5de4d8f065':
  Flesh out multi-user in am commands.
2012-09-10 17:16:20 -07:00
Dianne Hackborn
8ff4baf8e4 am aaf7fdbf: am 01a7c79d: Merge "Various fixes." into jb-mr1-dev
* commit 'aaf7fdbf89da3064a0ef95263a71b0a754b7e136':
  Various fixes.
2012-09-10 17:12:48 -07:00
Dianne Hackborn
234f00b9e8 am 789203ec: am 5d75052b: Merge "Add Binder.getCallingUserHandle()." into jb-mr1-dev
* commit '789203ec530e61f7678c9883a67135bf8cd3c679':
  Add Binder.getCallingUserHandle().
2012-09-10 17:09:33 -07:00
Dianne Hackborn
452b1ce2d4 am 3374ada6: am 824b959d: Merge "Explicitly specify current user everywhere home is started." into jb-mr1-dev
* commit '3374ada6ef0d8368b5fba38ee12c6ff9d5de8800':
  Explicitly specify current user everywhere home is started.
2012-09-10 17:09:15 -07:00
Amith Yamasani
f0d067ba44 am 4cf05484: am 5fc62663: Merge "Resolve the correct home intent for secondary users" into jb-mr1-dev
* commit '4cf0548452493cabbb7f7c09ab3ecb2ebe77ff8e':
  Resolve the correct home intent for secondary users
2012-09-10 17:07:59 -07:00
Dianne Hackborn
3f6f96b526 am 00b7d2a0: am 649d0d71: Merge "More multi-user stuff:" into jb-mr1-dev
* commit '00b7d2a0de5d235f7eab721d4369bf93af512351':
  More multi-user stuff:
2012-09-10 17:06:32 -07:00
Dianne Hackborn
1676c856d6 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
2012-09-10 14:52:30 -07:00
Dianne Hackborn
2d1b378191 Various fixes.
Bug #7132226: Can't start instrumentation due to ActivityManagerService crash
Bug #6912004: tap on gmail notification sends me to home screen

Change-Id: I824128b01f368de95dee288f8e49039b84479a7e
2012-09-09 18:14:32 -07:00
Dianne Hackborn
74ee8652e0 Add Binder.getCallingUserHandle().
Change-Id: I2a7eedfdc7baeeb4c2cd2ca0153aa95e0cf0bf45
2012-09-07 18:33:18 -07:00
Dianne Hackborn
d888399ad4 Explicitly specify current user everywhere home is started.
Change-Id: I58d86136de7f9cef1eaf72793d0e200b852d7355
2012-09-07 17:48:06 -07:00
Amith Yamasani
5fc626639a Merge "Resolve the correct home intent for secondary users" into jb-mr1-dev 2012-09-07 15:28:09 -07:00
Amith Yamasani
259d5e56a8 Resolve the correct home intent for secondary users
Fix some searches through the Activity stack.

This allows SetupWizard to be launched for the second user.

Change-Id: Icd306319f511c902557bd9985d80dda228e32d96
2012-09-07 15:04:36 -07:00
Dianne Hackborn
5e03e2ca7d More multi-user stuff:
- New (hidden) isUserRunning() API.
- Maintain LRU list of visited users.
- New FLAG_IS_DATA_ONLY for ApplicationInfo.
- Clean up pending intent records when force-stopping a user (or package).
  (Also fixes bug #6880627: PendingIntent.getService() returns stale
  intent of force stopped app)
- Fix force-stopping when installing an app to do the force-stop across
  all users for that app.
- When selecting which processes to kill during a force stop, do this
  based on the actual packages loaded in the process, not just process
  name matching.
- You can now use --user option in am when starting activities, services,
  and instrumentation.
- The am --user option accepts "current" and "all" as arguments.
- The pm uninstall command now uninstalls for all users, so it matches
  the semantics of the install command.
- PhoneWindowManager now explicitly says to start home in the current
  user.
- Activity manager call to retrieve the MIME type from a content provider
  now takes a user argument, so it will direct this to the proper user.
- The package manager uninstall paths are now implemented around
  PackageSetting, not PackageParser.Package.  This allows them to work
  even if the application's apk has been removed (in which case it only
  exists as a PackageSetting, not the PackageParser.Package parsed from
  the apk).

Change-Id: I3522f6fcf32603090bd6e01cc90ce70b6c5aae40
2012-09-07 13:55:23 -07:00