10094 Commits

Author SHA1 Message Date
Kenny Root
7abab32c00 am af101312: am 520ee7bc: am a2e8365c: am 9b0da58e: Merge "Introduce a restorecon JNI binding."
* commit 'af101312c880f440a2c33965e4479feaa1fd6b82':
  Introduce a restorecon JNI binding.
2012-08-16 15:37:16 -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
Nick Pelly
744d628d38 am 3f685a53: am 60020e2f: Merge "Improve coarse locations." into jb-mr1-dev
* commit '3f685a5319690baf0d405943757e09f23b409f8b':
  Improve coarse locations.
2012-08-16 15:27:40 -07:00
Nick Pelly
60020e2fa3 Merge "Improve coarse locations." into jb-mr1-dev 2012-08-16 15:23:11 -07:00
Nick Pelly
74fa7eabda Improve coarse locations.
Fix a couple of bugs, and modify the behavior of the random offset.

The random offset now slowly changes over time, to mitigate against
applications averaging out the offset over time while at a
grid boundary.

Change-Id: Iecffff29145b8c2b30d1eca1662cf9d3e8cff756
2012-08-16 15:22:24 -07:00
Jeff Sharkey
2ed2c64c73 am 849e985e: am c584b65b: Merge "Multi-user external storage support." into jb-mr1-dev
* commit '849e985ea9d6869a93f7618118aa51f70dad883e':
  Multi-user external storage support.
2012-08-16 14:40:10 -07:00
Kenny Root
9b0da58e3a Merge "Introduce a restorecon JNI binding." 2012-08-16 14:38:30 -07:00
Jeff Sharkey
c584b65b20 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:32:39 -07:00
Iliyan Malchev
9919595ac3 am 6afc0e24: am ee98610f: Merge "Set the brightness to zero on screen-off" into jb-mr1-dev
* commit '6afc0e2437bbbafe06b22f9d61fb5763c30e69bb':
  Set the brightness to zero on screen-off
2012-08-16 13:47:38 -07:00
Iliyan Malchev
ee98610f1a Merge "Set the brightness to zero on screen-off" into jb-mr1-dev 2012-08-16 13:43:14 -07:00
Dianne Hackborn
57ccc62e87 am fe1d3d4c: am f02b60aa: Rename UserId to UserHandle.
* commit 'fe1d3d4c52acd5b07466e8111a6db2c596a78a7f':
  Rename UserId to UserHandle.
2012-08-16 12:55:34 -07:00
Iliyan Malchev
122415f5c8 Set the brightness to zero on screen-off
Fixes b/6996990

Ideally, the HWC HAL should turn off the backlight when the display is turned
off.  This patch enforces this at the PowerManager, which can guard against
errant HWC implementations.

Change-Id: Ibb826a02871c983f8a68034d010e68abe9c5c1d5
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-08-16 12:48:28 -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
Jeff Brown
23e3ba534c am 778a616f: am 7c964e78: Merge changes I39804ee6,I6a5a7ea2 into jb-mr1-dev
* commit '778a616febe81517dc149bc4adc72a3e27bbc49e':
  Use spline interpolation for auto-brightness.
  Add FloatMath.hypot.
2012-08-16 02:11:25 -07:00
Jeff Brown
16296450e6 am 39b93467: am e6639750: Merge "Improve auto-brightness debounce." into jb-mr1-dev
* commit '39b9346728c28c3551c75b3d10ec2e8d9f8dc211':
  Improve auto-brightness debounce.
2012-08-16 02:11:22 -07:00
Jeff Brown
7c964e7899 Merge changes I39804ee6,I6a5a7ea2 into jb-mr1-dev
* changes:
  Use spline interpolation for auto-brightness.
  Add FloatMath.hypot.
2012-08-16 02:07:27 -07:00
Jeff Brown
e663975055 Merge "Improve auto-brightness debounce." into jb-mr1-dev 2012-08-16 02:06:18 -07:00
Jeff Brown
1a30b55036 Use spline interpolation for auto-brightness.
Strictly speaking, this is a change in behavior for all products.
Instead of using discrete zones, they will all now use spline
interpolation.  We could make this behavior configurable
but there seems to be little point to it.  The range of brightness
values used will be more or less the same as before, it's just
that what used to be the brightness value for all levels within
a particular zone now becomes the brightness value for the
highest level in that zone and lower values are used for lower
levels within the zone.

Change-Id: I39804ee630ba55f018e1e53c0576b28e7bd27931
2012-08-16 01:45:10 -07:00
Jeff Brown
06565b64de Improve auto-brightness debounce.
Change-Id: I045e2a14cb31ff987a22872733c442fc92ebadbf
2012-08-15 21:10:32 -07:00
Jeff Sharkey
5b1ada2562 Multi-user external storage support.
Emulated external storage always has multi-user support using paths
like "/data/media/<user_id>".  Creates and destroys these paths along
with user data.  Uses new ensure_dir() to create directories while
always ensuring permissions.

Add external storage mount mode to zygote, supporting both single-
and multi-user devices.  For example, devices with physical SD cards
are treated as single-user.  Begin migrating to mount mode instead
of relying on sdcard_r GID to enforce READ_EXTERNAL_STORAGE.

Bug: 6925012
Change-Id: I9b872ded992cd078e2c013567d59f9f0032ec02b
2012-08-15 19:45:53 -07:00
Dianne Hackborn
4906d4687e am 5de31846: am a1a1a1d6: Merge "Fix issue #6955586: No navigation bar in landscape on tablets" into jb-mr1-dev
* commit '5de318465192ec6edca8e1391f97515f13d20894':
  Fix issue #6955586: No navigation bar in landscape on tablets
2012-08-15 18:58:04 -07:00
Dianne Hackborn
a1a1a1d6ca Merge "Fix issue #6955586: No navigation bar in landscape on tablets" into jb-mr1-dev 2012-08-15 18:53:34 -07:00
Dianne Hackborn
5a052a4d19 Fix issue #6955586: No navigation bar in landscape on tablets
The window manager was telling the activity manager to evaluate
the new configuration when first initializing the display, before
actually setting mDisplay, so it failed creating that first config.

Change-Id: I6e94fcf55b0587ccf15a5fd7ecbe2c9a0c201b96
2012-08-15 18:49:23 -07:00
Irfan Sheriff
05f0c50075 am 602afdc0: am dea6cb78: Merge "CTS test for WiFi watchdog - framework support." into jb-mr1-dev
* commit '602afdc08282d22ba738ddcb7e516c3cf26ae087':
  CTS test for WiFi watchdog - framework support.
2012-08-15 16:33:39 -07:00
Yuhao Zheng
f6307820c8 CTS test for WiFi watchdog - framework support.
The new WiFi watchdog requires kernel/driver to export some packet loss
counters. This CTS tests whether those counters are correctly exported.

Change-Id: I41999676f8488e86f35f1f8214ce668f1a2b5638
2012-08-15 15:22:37 -07:00
Jeff Brown
76a2a59966 am e4e71e1d: am 194b6e97: Merge "Power manager rewrite." into jb-mr1-dev
* commit 'e4e71e1d06442726e23f8ccf66c75468634008c4':
  Power manager rewrite.
2012-08-15 10:30:52 -07:00
Jeff Brown
12c44d938e am c549d7fc: am 8ec8236f: Merge "Apply ValueAnimator scale factor immediately in WM." into jb-mr1-dev
* commit 'c549d7fc162285b237a824774df7826445635818':
  Apply ValueAnimator scale factor immediately in WM.
2012-08-15 10:10:17 -07:00
Jeff Brown
9630704ed3 Power manager rewrite.
The major goal of this rewrite is to make it easier to implement
power management policies correctly.  According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed.  Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off.  At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state.  Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once.  Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components.  For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed.  For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready.  An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants.  Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger).  This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep.  This change
removes ambiguity around forcing or disabling user activity
for various purposes.  To wake the device, use wakeUp().
To put it to sleep, use goToSleep().  Simple.

The power manager service interface and API has been significantly
simplified and consolidated.  Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
  different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
  in previous version of the power manager service pending
  an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
  for more compactly specifying auto-brightness levels
  in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
  KEEP_SCREEN_ON_FLAG wake lock instead of talking
  directly to the battery stats service.
- Optionally support animating screen brightness when
  turning on/off instead of playing electron beam animation
  (config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
2012-08-15 03:06:24 -07:00
Jeff Brown
ff7e6ef4f1 Apply ValueAnimator scale factor immediately in WM.
Normally the ValueAnimator scale factor is applied the first
time a ViewRootImpl window session is created but that may
be too late for animators created by system services that
start early in the boot process.  So set the scale factor
immediately whenever the setting changes.

Also make ValueAnimator.getDurationScale() accessible (but @hide)
for custom animators that want to apply the same scale to
their animations.

Change-Id: I0f5a750ab5b014f63848445435d8dca86f2a7ada
2012-08-15 02:09:05 -07:00
Matthew Xie
6e8f4d7820 am 3fe98084: am 58de1427: Merge "Implement enableNoAutoconnect()" into jb-mr1-dev
* commit '3fe98084e661f29c769664463f602a90a72c35c8':
  Implement enableNoAutoconnect()
2012-08-14 00:42:09 -07:00
Matthew Xie
58de1427c3 Merge "Implement enableNoAutoconnect()" into jb-mr1-dev 2012-08-14 00:37:01 -07:00
Ganesh Ganapathi Batta
fffa86ba83 Implement enableNoAutoconnect()
Adding enableNoAutoconnect() API support in Bluetooth service
 to let BT enable in quiet mode

Change-Id: I546f3ceb298082a9c9a698f406379470e3cc0d4f
2012-08-14 00:18:07 -07:00
Mike Lockwood
6e5a4946dd am c18184f1: am 510cff94: am f02354e2: am 9064a483: Merge "Added missing USB_DEVICE_ATTACHED broadcast to running Activity"
* commit 'c18184f14da6128db51b1343c6e466ac293a00e7':
  Added missing USB_DEVICE_ATTACHED broadcast to running Activity
2012-08-13 20:48:17 -07:00
Mike Lockwood
510cff9468 am f02354e2: am 9064a483: Merge "Added missing USB_DEVICE_ATTACHED broadcast to running Activity"
* commit 'f02354e208ec7b7e0dee68e12c0b5cde86a0f20a':
  Added missing USB_DEVICE_ATTACHED broadcast to running Activity
2012-08-13 20:45:04 -07:00
Mike Lockwood
f02354e208 am 9064a483: Merge "Added missing USB_DEVICE_ATTACHED broadcast to running Activity"
* commit '9064a48365c131ef5f64b26ab33dd40a7d1246a7':
  Added missing USB_DEVICE_ATTACHED broadcast to running Activity
2012-08-13 20:42:42 -07:00
Mike Lockwood
9064a48365 Merge "Added missing USB_DEVICE_ATTACHED broadcast to running Activity" 2012-08-13 19:59:38 -07:00
Christopher Tate
4c02cca213 am f5c0cf90: am bf7d2220: Merge "Don\'t back up / restore non-primary users\' data" into jb-mr1-dev
* commit 'f5c0cf90838ecb95893c9679fb5e352343fac12a':
  Don't back up / restore non-primary users' data
2012-08-13 18:02:52 -07:00
Christopher Tate
bf7d222011 Merge "Don't back up / restore non-primary users' data" into jb-mr1-dev 2012-08-13 17:58:40 -07:00
Christopher Tate
aac71ff465 Don't back up / restore non-primary users' data
For now only the device owner "user" gets cloud backups.  Also, only the
device owner account has access to local backup/restore.

Bug 6956438

Change-Id: I87d7ba5969e606c23f4214469f9bf2fd47a6c61b
2012-08-13 17:36:14 -07:00
Dianne Hackborn
8920f1cc73 am fd96eb05: am 1866f68d: Merge "Modify how the background process LRU list is handled." into jb-mr1-dev
* commit 'fd96eb05babf404e07366d09f71849c1aa0d20da':
  Modify how the background process LRU list is handled.
2012-08-13 17:19:27 -07:00
Dianne Hackborn
aa50ad3932 am dabd459f: am 87c42b99: Merge "Small service cleanup." into jb-mr1-dev
* commit 'dabd459f9083b4be22ae1f97517a5c2cb8010e5b':
  Small service cleanup.
2012-08-13 17:19:24 -07:00
Dianne Hackborn
1866f68dfe Merge "Modify how the background process LRU list is handled." into jb-mr1-dev 2012-08-13 17:15:04 -07:00
Dianne Hackborn
f88dd0b32e Small service cleanup.
Get rid of duplication between find/retrieve service funcs; when
a service in a persistent process crashes, restart it immediately
since the persistent process is going to be immediately restarted
anyway; when a new process is attaching, immediately restart any
services associated with it that are waiting to restart, since
it is weird to not let them run if the process comes back for some
other reason.

Change-Id: Id087fe04ebf2b6a4bd00732796c8326364765ea7
2012-08-13 17:11:47 -07:00
Dianne Hackborn
ee7621c0f5 Modify how the background process LRU list is handled.
A long time ago, we had a concept of an "empty" process -- this was
a process that didn't have any interesting components in it, which
would be placed below everything else in the LRU list.

Empty processes didn't work out well, because you could get into
bad situations where you have filled your LRU list with things that
have hidden activities, pushing empty processes to the bottom and
being immediately killed as soon as they go into the list.  So this
was removed.

This change brings the concept back, but in a slightly different
form, to address a more specific problem: for people who are switching
between N different applications, we would like to try to keep those
activities available in RAM in a consistent manner.  Currently the
previous activities would be killed often quickly and suprisingly,
even on devices with lots of RAM.  This is for two reasons:

(1) As you sit in one application, other things going on in the
background will go to the top of the LRU list, pushing down the
previous apps you have visited, even though you aren't aware at all
of these other things executing.
(2) There is a hard limit on the number of background processes
(currently 16) after which they are killed regardless of the amount
of available RAM.  This is desireable because if there is lots of
RAM we can end up with tons and tons of processes sitting around,
not really serving any purpose, but using up resources.

To improve the situation, we have again a concept of "empty" processes
but now it means one with no activities.  Processes that aren't empty
but in the background list are called hidden.  We maintain these as
two parallel lists, each getting half of the process limit: so with
a 16 process limit, you can have at most 8 empty and 8 hidden processes.

This allows us to consistently keep up to 8 recent applications around
for fast app switching; we will also keep around 8 other processes to
make it more efficient for background work to execute again if it needs
to.

Change-Id: Iee06e45efc20787da6a1e50020e5421c28204bd7
2012-08-13 17:09:19 -07:00
John Spurlock
924a953271 am 1e33ce8b: am 460847c7: Merge "Stop screensaver on incoming phone call." into jb-mr1-dev
* commit '1e33ce8b434b8ce277ebe1e4e9e4f2b46dc29682':
  Stop screensaver on incoming phone call.
2012-08-13 14:39:34 -07:00
John Spurlock
7be1a3d67c Stop screensaver on incoming phone call.
Use notification manager as an indicator of when to stop the screensaver
due to immediately-needed user interaction.

Any notification with a fullScreenIntent will now exit the screensaver.

Bug: 6976796
Change-Id: Id91cd4c32f3fad018b56f4dfe24b37110bab32d8
2012-08-13 16:45:12 -04:00
Kenny Root
ece42ed2f9 am be62be01: am 38cc2a5a: am 3221bf27: am 438a0efc: Do not eject internal ASECs when storage unmounted
* commit 'be62be01abb5132deb901d4ac12692e56d76f97c':
  Do not eject internal ASECs when storage unmounted
2012-08-13 11:46:12 -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