8350 Commits

Author SHA1 Message Date
Dianne Hackborn
5ac72a2959 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
2012-08-30 14:33:22 -07:00
Jean-Baptiste Queru
4698e36db6 am 6ab3ea5f: am 147ef944: am 60d1e1a0: Merge "Watchdog: Improvement of debuggability"
* commit '6ab3ea5f48abfd777d5bd18d92acc3bc766f78ce':
  Watchdog: Improvement of debuggability
2012-08-30 13:54:18 -07:00
Jean-Baptiste Queru
147ef94485 am 60d1e1a0: Merge "Watchdog: Improvement of debuggability"
* commit '60d1e1a09e4603e24652e930597ab204855eaa77':
  Watchdog: Improvement of debuggability
2012-08-30 13:49:58 -07:00
Jeff Sharkey
e217ee4d7a Access to all users' external storage.
System services holding this permission have external storage bound
one level higher, giving them access to all users' files.

Bug: 7003520
Change-Id: Ib2bcb8455740c713ebd01f71c9a2b89b4e642832
2012-08-30 10:37:51 -07:00
rikard dahlman
9211b13c32 Watchdog: Improvement of debuggability
If the watchdog detects a problem the system server process
is killed, that is followed by a crash. Because the crash is
done after the system server process is killed, the crash
don't contain info about the system server.
This improvement will make sure that the system is crashed
before the system server process is killed.
Behavior is only changed for eng and userdebug builds.

Change-Id: I9f1c8fd8b03d0114032ed44fb582705ad0b49733
2012-08-30 12:27:50 +02:00
Jeff Sharkey
428f53937e Merge "Locking when clearing VPN source rules." into jb-mr1-dev 2012-08-29 22:33:45 -07:00
Jeff Sharkey
580dd31a68 Locking when clearing VPN source rules.
Otherwise lockdown VPN reset is racy and can bring down system_server.

Change-Id: Ib8eecde1d0857a1669c3ca5506a46198c71b1b51
2012-08-29 22:31:58 -07:00
Jeff Sharkey
a99e4caa94 Merge "Bind to screenshot service for current user." into jb-mr1-dev 2012-08-29 22:29:43 -07:00
Amith Yamasani
694121c400 Merge "Fix an NPE in PackageManager when getting the AppInfo for an app" into jb-mr1-dev 2012-08-29 18:52:14 -07:00
Amith Yamasani
317046a087 Fix an NPE in PackageManager when getting the AppInfo for an app
Bug: 7072043
Change-Id: I37378b13820152434e7b3249e13c27001fe4ae5a
2012-08-29 18:48:08 -07:00
Jeff Brown
d0dd63dcae Tweak overlay display adapter scaling.
Change-Id: I330fc019c5b3f4e03369e6f1c1a839a33f6ce0e3
2012-08-29 18:45:32 -07:00
Dianne Hackborn
12631ec35e Merge "Start implementing concept of "running" users." into jb-mr1-dev 2012-08-29 18:15:07 -07:00
Benoit Goby
ffc45b7d57 Merge "UsbDebuggingManager: Fix restart when toggling USB debugging" into jb-mr1-dev 2012-08-29 17:05:26 -07:00
Irfan Sheriff
a28c18fc61 Merge "Fix DHCP handling at disconnect/reconnect" into jb-mr1-dev 2012-08-29 15:55:43 -07:00
Jeff Brown
d5ea3b4647 Merge "Add initial multi-display support." into jb-mr1-dev 2012-08-29 15:43:55 -07:00
Benoit Goby
509bf2d2cf UsbDebuggingManager: Fix restart when toggling USB debugging
Change-Id: Iaaec9162b03c4ea77735d096eec670392c61308a
2012-08-29 15:43:51 -07:00
Irfan Sheriff
6bfc88876a Fix DHCP handling at disconnect/reconnect
Wifi can have a quick disconnection followed by a reconnection. We used to
create a new DHCP state machine thread for every new connection and
never really waited until it quit after disconnect. This may have lead to
situations where repeated disconnect/reconnects resulted in multiple dhcp
start calls.

We now keep the statemachine after a disconnect and only shut it at supplicant
stop.

Bug: 6417686
Change-Id: Icf66efdc654be886e3eb46c81f09f8cce536f2f6
2012-08-29 15:35:57 -07:00
Jeff Brown
bd6e1500ae Add initial multi-display support.
Split the DisplayManager into two parts.  One part is bound
to a Context and takes care of Display compatibility and
caching Display objects on behalf of the Context.  The other
part is global and takes care of communicating with the
DisplayManagerService, handling callbacks, and caching
DisplayInfo objects on behalf of the process.

Implemented support for enumerating Displays and getting
callbacks when displays are added, removed or changed.

Elaborated the roles of DisplayManagerService, DisplayAdapter,
and DisplayDevice.  We now support having multiple display
adapters registered, each of which can register multiple display
devices and configure them dynamically.

Added an OverlayDisplayAdapter which is used to simulate
secondary displays by means of overlay windows.  Different
configurations of overlays can be selected using a new
setting in the Developer Settings panel.  The overlays can
be repositioned and resized by the user for convenience.

At the moment, all displays are mirrors of display 0 and
no display transformations are applied.  This will be improved
in future patches.

Refactored the way that the window manager creates its threads.
The OverlayDisplayAdapter needs to be able to use hardware
acceleration so it must share the same UI thread as the Keyguard
and window manager policy.  We now handle this explicitly as
part of starting up the system server.  This puts us in a
better position to consider how we might want to share (or not
share) Loopers among components.

Overlay displays are disabled when in safe mode or in only-core
mode to reduce the number of dependencies started in these modes.

Change-Id: Ic2a661d5448dde01b095ab150697cb6791d69bb5
2012-08-29 15:34:17 -07:00
Benoit Goby
37ce5c5d5e UsbDebuggingManager: add missing break in switch
Bug: 7079044
Change-Id: Icf4090e79af47db7d068981537c97f2028d8e405
2012-08-29 13:52:17 -07:00
Amith Yamasani
4e2820c22b Fix adding live wallpaper in a second user
When the second user downloads a new wallpaper service, Wallpaper
service needs to query the correct user's package state to figure
out if it is available and bind to it.

Change-Id: Ifb95db1c859887f996f5b2e821b4b46510ee7016
2012-08-28 22:45:17 -07:00
Craig Mautner
c479b55abe Merge "Check proximity detector before powering off." into jb-mr1-dev 2012-08-28 17:16:28 -07:00
Craig Mautner
4ccbdd1770 Check proximity detector before powering off.
Do not automatically power off if the proximity detector wakelock is
active.

Fixes bug 7047455.

Change-Id: I44e30bf388292e5c476dfb5d0de9226d21853e4d
2012-08-28 17:12:52 -07:00
Amith Yamasani
c3815a5679 Merge "Fix PendingIntent caching for multiuser" into jb-mr1-dev 2012-08-28 16:56:19 -07:00
Jeff Sharkey
35744c19f6 Bind to screenshot service for current user.
Let apps bindService() across user boundaries if they hold the
INTERACT_ACROSS_USERS_FULL permission.

Bug: 7012034
Change-Id: I2047d8318e1de47bfae7470d1dbc6fe5cfe44fdc
2012-08-28 16:49:10 -07:00
Dianne Hackborn
80a4af2bbc 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
2012-08-28 16:30:55 -07:00
Dianne Hackborn
def8b0f011 Merge "Fix infinite loop when uninstalling apps." into jb-mr1-dev 2012-08-28 16:01:53 -07:00
Dianne Hackborn
377de7b13e Fix infinite loop when uninstalling apps.
Change-Id: Ibdf7fa832529a358d1115fc300651101c5185484
2012-08-28 15:57:33 -07:00
rich cannings
2deaa3698d Merge "Add permission checks for Verification API calls" into jb-mr1-dev 2012-08-28 15:14:26 -07:00
Amith Yamasani
4ea6069323 Fix PendingIntent caching for multiuser
Store the userId in the PendingIntentRecord.Key, so that it doesn't match
an identical pending intent from another user.

Change-Id: Icfc39e0f717c902dc3a60bdf5283a3402bbd2eaa
2012-08-28 14:34:53 -07:00
rich cannings
7e67151b91 Add permission checks for Verification API calls
Ensure that only applications with
android.Manifest.permission.PACKAGE_VERIFICATION_AGENT can call application
verification APIs, like PackageManager.verifyPendingInstall and
PackageManager.extendVerificationTimeout

Bug: 7049083
Change-Id: I5fc28b37e864d67cd319a1ed9d03a90dd15ad052
2012-08-28 14:00:46 -07:00
Irfan Sheriff
da6da0907b Captive portal handling
We now notify the user of a captive portal before switching to the network as default.
This allows background applications to continue to work until the user confirms he
wants to sign in to the captive portal.

Also, moved out captive portal handling out of wifi as a seperate component.

Change-Id: I7c7507481967e33a1afad0b4961688bd192f0d31
2012-08-27 22:27:06 -07:00
Amith Yamasani
10a0df8459 Merge "Relax permission requirement for sending broadcasts to other users" into jb-mr1-dev 2012-08-27 19:33:42 -07:00
Amith Yamasani
8bf06edac2 Relax permission requirement for sending broadcasts to other users
Also handle USER_CURRENT for broadcasts

Change-Id: I2df5616ac22b7c670a7d007b8d505d4d4d99a24e
2012-08-27 19:30:30 -07:00
Jeff Brown
dc7d8008ec Merge "Add plumbing for new surface flinger display API." into jb-mr1-dev 2012-08-27 17:16:53 -07:00
Dianne Hackborn
0e17e5bc43 Merge "Fix installing applications from non-primary users." into jb-mr1-dev 2012-08-27 15:59:56 -07:00
Dianne Hackborn
786b44046a Fix installing applications from non-primary users.
We also now send the correct broadcasts to each user.

You no longer need to be running the shell as root
to be able to create/remove users.

Also added some more man page material to the pm command, and
got rid of a bunch of showUsage() calls that now make error
messages completely buried because of how large the usage info
has become.

And the package manager now shows the user each historical broadcast
was sent to.

Change-Id: Iab42498e1352a0c023069139c80fc04d2d69ab4b
2012-08-27 15:16:33 -07:00
Brian Muramatsu
a97ec810e0 Merge "Remove unused IntentFilter in LocationManager" into jb-mr1-dev 2012-08-27 14:59:11 -07:00
Jeff Brown
64a55af0ac Add plumbing for new surface flinger display API.
Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
2012-08-27 14:34:54 -07:00
Jeff Sharkey
116ee10b95 Merge "Always-on VPN." into jb-mr1-dev 2012-08-27 13:57:58 -07:00
Jeff Sharkey
69ddab4575 Always-on VPN.
Adds support for always-on VPN profiles, also called "lockdown." When
enabled, LockdownVpnTracker manages the netd firewall to prevent
unencrypted traffic from leaving the device. It creates narrow rules
to only allow traffic to the selected VPN server. When an egress
network becomes available, LockdownVpnTracker will try bringing up
the VPN connection, and will reconnect if disconnected.

ConnectivityService augments any NetworkInfo based on the lockdown
VPN status to help apps wait until the VPN is connected.

This feature requires that VPN profiles use an IP address for both
VPN server and DNS. It also blocks non-default APN access when
enabled. Waits for USER_PRESENT after boot to check KeyStore status.

Bug: 5756357
Change-Id: If615f206b1634000d78a8350a17e88bfcac8e0d0
2012-08-27 12:35:05 -07:00
Andy Stadler
be7ddb9f29 Merge "Fix package verifier lookup" into jb-mr1-dev 2012-08-27 12:28:05 -07:00
Amith Yamasani
a84a4af9b1 Merge "Fix adb install" into jb-mr1-dev 2012-08-27 12:24:24 -07:00
Amith Yamasani
2b91465233 Fix adb install
Was not properly handling creating DefContainerService when the installation was
for USER_ALL. Not a problem for Market installs.

Bug: 7061571
Change-Id: I4528b4c56e38effa137da56460e78c55b242ba45
2012-08-27 12:04:40 -07:00
Irfan Sheriff
63dc027be2 Merge "Fix permission issue on channel" into jb-mr1-dev 2012-08-27 11:59:16 -07:00
Craig Mautner
3486b9696d Fix drag bug.
Previous assumption -- that the drag window was defined at time of
DragState construction -- was false. The window, and hence the
Display, is not known until performDrag. This change delays assigning
DragState.mDisplayContent until the window/Display is known.

Fixes bug 7028203.

Change-Id: I5799005652c484ff0c45ab340ce3b9e4b784883e
2012-08-27 11:31:24 -07:00
Jean-Baptiste Queru
af18865486 am ba37d595: am e70a32af: am eb00f951: Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
* commit 'ba37d595f70d348987a9e60c56c071fdd319260f':
  VibratorService: Fix to ensure actual delay in a vibrate pattern
2012-08-27 08:16:02 -07:00
Jean-Baptiste Queru
ba37d595f7 am e70a32af: am eb00f951: Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
* commit 'e70a32afc5b27ddc9681efd867780a0c4c77edd3':
  VibratorService: Fix to ensure actual delay in a vibrate pattern
2012-08-27 08:13:27 -07:00
Jean-Baptiste Queru
eb00f95143 Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern" 2012-08-27 07:55:41 -07:00
Jeff Brown
d59db50ab0 Merge "Initialize screen state earlier in the boot process." into jb-mr1-dev 2012-08-25 13:46:49 -07:00
Jeff Brown
04a286b955 Merge "Fix GpsLocationProvider wake lock book keeping." into jb-mr1-dev 2012-08-25 13:44:51 -07:00