Commit Graph

811 Commits

Author SHA1 Message Date
Dianne Hackborn
fe0d0f1d76 am fbbd0072: am 3ff8e1a8: Merge "Fix issue #7211769 and #7244492, thrash around on #7226656." into jb-mr1-dev
* commit 'fbbd0072ebb2cef61cf3b51712181c00b4f5ea54':
  Fix issue #7211769 and #7244492, thrash around on #7226656.
2012-09-28 16:19:44 -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
Amith Yamasani
60a030e781 am ed7989e4: am 01996793: Merge "Remove user switcher from long-press power menu" into jb-mr1-dev
* commit 'ed7989e49fd2c668865b156cae5f5faa1603825a':
  Remove user switcher from long-press power menu
2012-09-28 11:13:17 -07:00
Amith Yamasani
bc4ba82335 Remove user switcher from long-press power menu
Bug: 7252218

Also lock the screen before doing the user switch. This prevents the
janky behavior of showing the target user's homescreen after the switch
and then the lock screen. This is also a privacy issue.

Change-Id: I9f8db047335d06fc93505d7b5cca71e27ca3ac39
2012-09-28 10:21:32 -07:00
Jeff Sharkey
b81c7bb932 am 65f4de10: am 3a8af8ef: Merge "Migrate more Secure settings to Global." into jb-mr1-dev
* commit '65f4de101fa8d5752603c6e79536c3a17f585490':
  Migrate more Secure settings to Global.
2012-09-28 00:36:41 -07:00
Jeff Sharkey
625239a054 Migrate more Secure settings to Global.
Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
2012-09-27 16:22:53 -07:00
Dianne Hackborn
7e31a58e55 am ce56b399: am 2480bc12: Merge "Fix issue #7232952: Settings crash on tapping on Downloaded apps on a secondary user" into jb-mr1-dev
* commit 'ce56b399e1e71f97ec9830ad0973f44555c0fd4f':
  Fix issue #7232952: Settings crash on tapping on Downloaded apps on a secondary user
2012-09-27 00:57:09 -07:00
Dianne Hackborn
c7ba771a45 Fix issue #7232952: Settings crash on tapping on Downloaded apps on a secondary user
Also tweak bind flags for new location services so they
aren't put so aggressively up in the oom adj list.

Change-Id: I9da25a3fea7681013b4d95b7db7e9a808f2d733b
2012-09-26 23:22:59 -07:00
Dianne Hackborn
c14a9113c5 am e440f47d: am e5215730: Merge "Maybe fix issue #7211766: bindService() to User u0 While u10 is..." into jb-mr1-dev
* commit 'e440f47d95cefe02bc76d6b57d6e2b248b052f93':
  Maybe fix issue #7211766: bindService() to User u0 While u10 is...
2012-09-26 15:00:23 -07:00
Dianne Hackborn
b12e1354f2 Maybe fix issue #7211766: bindService() to User u0 While u10 is...
...Forground Sometimes Doesn't Take

The main change here is a one-liner in ActiveServices to check the
uid when deciding whether to remove an item from mPendingServices.
This could cause the problem being seen -- if the same service for
two users is starting at the same time, the second one would blow
away the pending start of the first one.  Unfortunately I have had
trouble reproducing the bug, so I don't know if this is actually
fixing it.  It's a bug, anyway.

The reason so much has changed here is because I spread around
logging and printing of the user ID associated with operations and
objects to make it easier to debug these kind of multi-user things.

Also includes some tweaks to the oom manager to allow more background
processes (I have seen many times in logs where we thrash through
processes because the LRU list is too short), plus to compensate an
additional time-based metric for when to get rid of background processes,
plus some new logic to try to help things like Chrome keep around
their service processes.

Change-Id: Icda77fb2a1dd349969e3ff2c8fff0f19b40b31d3
2012-09-26 14:50:12 -07:00
Jeff Brown
9da4d74477 am 876f95ed: am b32e2216: Merge changes I332f020f,I632648ac into jb-mr1-dev
* commit '876f95ed7f914b4d86634db552277f835d288805':
  Update references to migrated global settings.
  Handle user switched for settings changes.
2012-09-25 17:11:25 -07:00
Jeff Brown
bf6f6f9de7 Update references to migrated global settings.
Fixed one setting that was migrated but not marked deprecated.

Removed a hidden setting that is no longer used by the new
power manager service.

Bug: 7231172
Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
2012-09-25 15:27:51 -07:00
Amith Yamasani
95293865bd Fix build
Merge error...

Change-Id: I0e674ee25a080fa6abfaa9da893084d6b4fa69a6
2012-09-25 09:39:36 -07:00
Jean-Baptiste Queru
7951c459ae Merge into jb-mr1-dev
Change-Id: Ifc2328e30a52c2baebc1322c9b161104dcf21618
2012-09-25 09:36:32 -07:00
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