26654 Commits

Author SHA1 Message Date
Kenny Root
9a994b5350 am 050c87f8: am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit '050c87f87e2a48c7bc90f5b15fb6e4e37e667286':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:43:20 -07:00
Kenny Root
050c87f87e am a950daf5: Merge changes Ieb566a2a,I953057cd
* commit 'a950daf5c14a0009c2c62e9c3e0e8d51eb0cf7d9':
  Use Libcore's stat instead of FileUtils#getFileStatus
  Use Libcore.os.stat instead of FileUtils
2012-08-16 16:33:40 -07:00
Chet Haase
cc48c144bb Merge "Make animators more robust against ending mid-stream" into jb-mr1-dev 2012-08-16 15:35:29 -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
Kenny Root
98e15e7893 Use Libcore's stat instead of FileUtils#getFileStatus
Remove the last user of FileUtils#getFileStatus and move it to
Libcore.os.stat instead. Then we can remove the JNI code that does the
equivalent of a stat.

Change-Id: Ieb566a2a8a17c2dd0150724b4eb3ac1cc41c823d
2012-08-16 15:27:55 -07:00
Kenny Root
786cbcacd2 Use Libcore.os.stat instead of FileUtils
PackageManagerService just needed to know the owner for this file, so
just use stat instead so we can remove the old JNI code.

This is the last user of FileUtils#getPermissions so just remove the
FileUtils method as well.

Change-Id: I953057cd6b9de4410f33b6f22e4bddff02fe2988
2012-08-16 15:27:55 -07:00
Kenny Root
9b0da58e3a Merge "Introduce a restorecon JNI binding." 2012-08-16 14:38:30 -07:00
Chet Haase
2936fc0244 Make animators more robust against ending mid-stream
The logic in the frame processing code of ValueAnimator did not handle
the situation of animators being ended while the current animation list
was being processed. In particular, if a call to an animation update
(which could result in a call out to user code) caused that animation, or
other current animators, to end, then there was the risk of running off the
end of the list of current animators.

The fix is to work from a copy of the current animator list, processing frames
on each one only if they also exist in the real animations list.

Issue #6992223 Frequent System UI crash

Change-Id: I742964558f8354f04c311b7b51c7686f26a4dacf
2012-08-16 14:34:04 -07:00
Jeff Sharkey
c584b65b20 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:32:39 -07:00
Kenny Root
a579f7926a am d69b47c0: am 8942e5a3: Merge "Use libcore Posix class for StatFs implementation"
* commit 'd69b47c087a87355df76a5276ab18af847f64367':
  Use libcore Posix class for StatFs implementation
2012-08-16 14:26:07 -07:00
Kenny Root
d69b47c087 am 8942e5a3: Merge "Use libcore Posix class for StatFs implementation"
* commit '8942e5a32ae2d1a36b65efe5b26cc06227ea0ca5':
  Use libcore Posix class for StatFs implementation
2012-08-16 14:22:31 -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
Kenny Root
bdd23ae9f5 Use libcore Posix class for StatFs implementation
Remove some JNI and duplicated functionality and use libcore's Posix
class for the statfs function instead.

Change-Id: Ic1e161dc10c18c2c6ee81d895a0efd8910086dbf
2012-08-16 10:55:47 -07:00
Steve Block
7bf70dd1ac Merge "Fix alpha value for device orientation" into jb-mr1-dev 2012-08-16 04:38:03 -07:00
Steve Block
d5be055f79 Fix alpha value for device orientation
This seems to have been incorrect since this code was first written for HC. I
can only think that the error was made due to confusion between portrait and
landscape mode as development switched from phones to tablets.

Tested on stingray and prime.

A similar fix will be required for Chrome.

Change-Id: I5da13c489fdb9de340b9e6ea8868c9f1adc15bb2
2012-08-16 11:04:51 +01: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
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
270e3381e7 Add FloatMath.hypot.
Change-Id: I6a5a7ea2254300614dbbf540f40e39dbec2d2900
2012-08-16 01:30:22 -07:00
Daniel Sandler
228916713d Merge "Multiuser support for notifications, take 1." into jb-mr1-dev 2012-08-15 21:03:26 -07:00
Daniel Sandler
b9301c3a68 Multiuser support for notifications, take 1.
Notifications for background users are hidden from the
panel and status bar.

Still need to add a concept of "any user" notifications (for
things coming from the system) and notification visibility
controls (for access to icons + possibly masked text of
a background user's notifications).

Change-Id: Iba121f35a6c25c2e1c44db029d776a5a59a6a008
2012-08-15 23:00:56 -04: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
Michael Jurka
524c878e7e Revert "Merge "Reload page when A11y is on and the JavaScript state changes." into jb-mr1-dev"
This reverts commit 6d00c724330702c6bfd2bba2b7b2501fa3ab62ff, reversing
changes made to 41bfb75f7c76588239ed5d2d4e38aeb1762ff348.
2012-08-15 19:39:55 -07:00
Svetoslav Ganov
6d00c72433 Merge "Reload page when A11y is on and the JavaScript state changes." into jb-mr1-dev 2012-08-15 18:30:57 -07:00
Svetoslav Ganov
41bfb75f7c Merge "Only inject accessibility when speaking service enabled." into jb-mr1-dev 2012-08-15 18:29:26 -07:00
Dianne Hackborn
e9c2f18c8e Merge "Add more debug info when a container view ID can't be found." into jb-mr1-dev 2012-08-15 14:36:53 -07:00
Dianne Hackborn
5bf6e1a1db Add more debug info when a container view ID can't be found.
Change-Id: Ibb2afc49747bd2d0ac24605cb3ec390334f8abf8
2012-08-15 14:33:32 -07:00
George Mount
21029db157 Merge "Number and telephone inputs -- use "Go" instead of "Next"" into jb-mr1-dev 2012-08-15 10:44:07 -07:00
Jeff Brown
194b6e9716 Merge "Power manager rewrite." into jb-mr1-dev 2012-08-15 10:26:03 -07:00
George Mount
68c0c12631 Number and telephone inputs -- use "Go" instead of "Next"
Bug 6988736

Change-Id: I36e85832bdd53ea0f7eb422104966b403b8fbcdd
2012-08-15 10:15:50 -07:00
Jeff Brown
8ec8236f5c Merge "Apply ValueAnimator scale factor immediately in WM." into jb-mr1-dev 2012-08-15 10:04:38 -07:00
Steve Block
65dfac3bb5 Merge "Clean up JavaDoc for CookieManager" into jb-mr1-dev 2012-08-15 04:15:08 -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
Jeff Brown
f8d9e2fccd Merge "Make all messages in KeyguardViewMediator asynchronous." into jb-mr1-dev 2012-08-14 21:28:52 -07:00
Jeff Brown
109025d778 Make all messages in KeyguardViewMediator asynchronous.
We don't want these messages to get blocked by UI traversals.

Added a convenience for creating Handlers that always send
asynchronous messages.

Change-Id: Id568e87fcb8b169e8c52c5fe1dc76a4a5771570b
2012-08-14 20:44:44 -07:00
Dianne Hackborn
abac0cd161 Merge "Add PendingIntent and IntentSender APIs to get user handle." into jb-mr1-dev 2012-08-14 18:24:59 -07:00
Dianne Hackborn
c7501279ee Add PendingIntent and IntentSender APIs to get user handle.
Also uid.

Change-Id: I0a328d0cc2bbc17dc0a49b7b8b8d515af80f1e15
2012-08-14 18:05:05 -07:00
Dianne Hackborn
34743ac7d6 Merge "Add API to create new contexts with custom configurations." into jb-mr1-dev 2012-08-14 17:33:01 -07:00
Dianne Hackborn
756220bd19 Add API to create new contexts with custom configurations.
This allows you to, say, make a Context whose configuration
is set to a different density than the actual density of the device.

The main API is Context.createConfigurationContext().  There is
also a new API on ContextThemeWrapper that allows you to apply
an override context before its resources are retrieved, which
addresses some feature requests from developers to be able to
customize the context their app is running in.

Change-Id: I88364986660088521e24b567e2fda22fb7042819
2012-08-14 16:51:38 -07:00
Amith Yamasani
07d1b28904 Merge "Launch ASSIST intent on the current user" into jb-mr1-dev 2012-08-14 16:34:48 -07:00
Fabrice Di Meglio
d63b992210 Merge "Fix bug #6908329 TextUtils.ellipsize does not work properly when Locale is changed" into jb-mr1-dev 2012-08-14 14:03:51 -07:00
Fabrice Di Meglio
f3e64101bb Fix bug #6908329 TextUtils.ellipsize does not work properly when Locale is changed
- load the ellipis resources on the fly to get the correct ones depending on the Locale

Change-Id: I42d591e3f5ed715c983f736f94a80143a3897f47
2012-08-14 14:01:53 -07:00
Scott Main
a5d1dc9d03 am bd63fb87: am 6958c161: Merge "docs: misc bug fixes from external issues" into jb-dev
* commit 'bd63fb875c49d69d5969df35ae159bd17cadb730':
  docs: misc bug fixes from external issues
2012-08-14 12:42:12 -07:00
Scott Main
bd63fb875c am 6958c161: Merge "docs: misc bug fixes from external issues" into jb-dev
* commit '6958c161a9f12aaa1db33bdc526040c3691638dc':
  docs: misc bug fixes from external issues
2012-08-14 12:40:41 -07:00
Amith Yamasani
c1d07a4bd2 Launch ASSIST intent on the current user
Lockscreen and statusbar now launch the intent on the current user.
Make sure that the intent resolution is made to the package manager
for the specific user, as the app could have been disabled for that
user or may have an alternative app installed.

Change-Id: I93b0f972d6c7e8880b146da83dc3d08a68fe7e51
2012-08-14 12:39:29 -07:00
Chiao Cheng
472f416140 Merge "Adding limit and offset query parameters to CallLog." into jb-mr1-dev 2012-08-14 10:53:19 -07:00
Narayan Kamath
9c3d7a888d Fixes to TextToSpeechService#synthesizeToFile
- Fixes a strict mode violation, defers file validity checks
  to when the engine starts synthesizing audio.
- Fixes some log spam when done() is called twice.

bug:6215680
bug:5415258
Change-Id: I4001be848b5208422d4091b7398e94ed311c649f
2012-08-14 08:38:26 -07:00
Narayan Kamath
ed4e541a20 Fix bug in BlockingAudioTrack.
Will be seen when createStreamingAudioTrack() returns null,
which will happen if the audioflinger / audiomanager are unhealthy.

Also removes some confusing synchronization from this class.

bug:6636401
Change-Id: Iaf68a305665b7bc973898145e9cd1563e2569a2b
2012-08-14 08:36:27 -07:00
Daniel Sandler
a6aef1bbb4 Merge "New status bar capable of multiple sliding panels." into jb-mr1-dev 2012-08-14 07:56:44 -07:00