8360 Commits

Author SHA1 Message Date
Dianne Hackborn
210c1a262a am 2aae2d96: am 01011c3d: Fix issue #6037252: Screen shifts after all apps are upgraded
* commit '2aae2d9633dab528b74fb4d9c8266d82638e05ff':
  Fix issue #6037252: Screen shifts after all apps are upgraded
2012-02-21 14:59:38 -08:00
Dianne Hackborn
f08beab2d1 am 01011c3d: Fix issue #6037252: Screen shifts after all apps are upgraded
* commit '01011c3d7ce4f76c1a76b33a04fc63da784ddbea':
  Fix issue #6037252: Screen shifts after all apps are upgraded
2012-02-21 14:57:46 -08:00
Dianne Hackborn
01011c3d7c Fix issue #6037252: Screen shifts after all apps are upgraded
Two things: (1) make sure the boot message is always positioned within
the entire unrestricted display, and (2) allow the dim background to go
on top of the nav bar when being used for the boot message (this latter
is really a hack that should be more generally fixed in the future).

Change-Id: I7261b044eb802a39cadff931b50a679ff18781d6
2012-02-21 13:54:21 -08:00
Mathias Agopian
1ebe8aa23f Merge "frameworks/base refactoring" 2012-02-21 12:52:06 -08:00
Craig Mautner
2f995a7eaa - Consolidate all animations in a single place outside of layout loop.
- Move mPolicy.startAnimationLw and mPolicy.finishAnimationLw into same method as mPolicy.animatingWindowLw.
- Fix first parameter of performLayoutLockedInner(initial, ...) to pass true on initial pass.

Change-Id: If1b47bb8a7e03cf427769c657e371abc0910b3e3
2012-02-21 09:53:21 -08:00
Glenn Kasten
06d91936eb Merge "createSurface getpid() first parameter was removed" 2012-02-21 07:24:16 -08:00
Mathias Agopian
7c536831d0 Merge "SurfaceFlinger: set wrap mode on screenshot texture" 2012-02-20 22:50:36 -08:00
Mathias Agopian
83c64e6b62 frameworks/base refactoring
create the new libandroidfw from parts of libui and libutils

Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
2012-02-20 22:38:43 -08:00
Todd Poynor
94d0024557 Power HAL PowerManagerService hookup
Use PowerHAL to set system awake/suspend state.

Change-Id: If58a6f548564ea141b68f304455997d9ff04eace
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2012-02-17 22:19:45 -08:00
Mathias Agopian
b93a03f841 frameworks/base refactoring.
First step. Move libui includes to their new home: androidfw.

Change-Id: Ic042b52fdba72f30edc3cc6339bf30b4c1b99662
2012-02-17 15:36:10 -08:00
Glenn Kasten
c35761e15c Merge "Remove bit fields to improve performance" 2012-02-17 10:45:02 -08:00
Jeff Brown
ba217ef207 Merge "Ignore broken input channel when finishing input event." 2012-02-17 10:30:50 -08:00
Jeff Brown
9806a2307f Ignore broken input channel when finishing input event.
There are occasional races during application shut down where the
input dispatcher will close an input channel before the application
has finished its last event.  So just ignore EPIPE.

Also tweak the logging for failed input event injection to make
it clearer which pid was trying to perform the injection.

Bug: 6013004
Change-Id: I7bbb01441d41762b03eafd4d39dcf0323e1cadf3
2012-02-17 10:28:09 -08:00
Mike Lockwood
51723c821a Merge "New clock sync control loop." 2012-02-17 09:47:47 -08:00
Kent Ryhorchuk
11bc45fcba New clock sync control loop.
Change clock sync control to velicity form PI loop. Tuned for office LAN and
WiFi conditions, will probably perform better in clean environments.
Improve packet filtering to prevent clock sync on bad rtt.
Changed diag interface to take rtt times, P, I, D are no longer supported.

Change-Id: Iad2b26eb44cd222ec5f219b49669e2d6baec9d1c
2012-02-17 09:46:37 -08:00
Glenn Kasten
4f22c05eac Remove bit fields to improve performance
uint16_t enabled is (mostly) changed to bool in a separate CL

Change-Id: Ied9f8c034b2479cee9a8778cee7b8ff92ae75b7b
2012-02-17 09:41:56 -08:00
Glenn Kasten
e13ac73a38 Merge "Simplify code" 2012-02-17 09:40:43 -08:00
Glenn Kasten
7d3be3a3c1 Simplify code
Use DefaultKeyedVector::valueFor to avoid extra test
Make local variables as local as possible
No double parentheses
No typedef for single use
No parentheses around indirect function call
No AudioFlinger:: prefix when not needed
Remove unnecessary casts
Remove block with only one line

Saves 128 bytes

Change-Id: I3a87430eeb01b81e7b81a1c38f6fdd3274ec48f3
2012-02-17 09:39:07 -08:00
Mike Lockwood
e7c84be432 Merge "Put a bandaid on a segfault in timed audio track handling." 2012-02-17 09:20:43 -08:00
Glenn Kasten
df344b6f78 Merge "Fixed possible heap corruption in EffectDesc" 2012-02-17 09:19:49 -08:00
Dianne Hackborn
b9ee4f4425 Merge "Revert "Don't wait for current activity to pause before resuming next."" 2012-02-16 18:01:31 -08:00
John Grossman
8c010615bf Put a bandaid on a segfault in timed audio track handling.
Add a bandaid to prevent a segfault which can occur while handling
timed audio buffers.  There is a deeper problem which should
eventually be addressed, but for now this fix should prevent any
crashing.

The deeper problem is as follows.

When the AudioFlinger mixer gets data to mix from an AudioTrack, it
ends up getting a structure filled out which points into an IMemory
region owned by the AudioTrack.  Unfortunately, this structure is not
holding a refcount on the IMemory which it points into.  If the
IMemory refcount hits 0 and the chunk of RAM is retuned to the binder
heap it came from, there can still be a Buffer object being held by
the AudioFlinger mixer which points into the region of memory which
was retuned to the binfer heap.  If AF reads from this buffer, it
could read corrupt data (if the region of memory gets handed back out
to a writer), or it could segfault (if the heap has been freed and the
pages unmapped).  Similar problems could happen if AF attempts to
write to the buffer, heap corruption in one case, segfaulting in the
other.

In the past, this has not been an issue for AF, because tracks
allocate a single IMemory (which serves as a ring buffer) and the
IMemory lives for as long as the track lives.  As an artifact of the
way the code came out, the mixer cannot be holding a Buffer structure
pointing into the IMemory which used to be owned by a track if the
track no longer exists.  Tracks cannot come into or out of existence
during a mix operation, which is the only thing which makes this safe.

TimedTracks work differently, however.  Timed tracks each allocate a
small binder heap, and then hand out IMemory instances  broken out of
this heap.  The heap lives as long as the track, so the worst which
could happen here is that a TimedTrack's IMemory gets returned to the
heap while there is still a buffer structure in flight pointing into
the memory region, then the region gets handed out again and
overwritten by new data causing the mixer to mix the wrong audio.  The
timing to cause this to happen is very difficult to encounter, and you
to generate the timing conditions required, you need to be in a pretty
bad failure state where audio is already breaking up and skipping, so
its unlikely that anyone would notice (which is why I'm band-aiding
the segfault and letting the deeper issue slide for now).

In general, however, it might be a good idea to revisit this buffering
design.  On principal, if someone is going to hold pointers into a
refcounted object, they should be holding a ref on the object at the
same time.  Failure to do this will usually lead to a situation where
there are corruption or segfault issues, or to a system where the
refcounted object's lifetime must be implicitly managed very carefully
in ways which are usually non-obvious and are easy to break by new
engineers on a project.

Change-Id: Ib391075395ed0ef46a03c37aa38a82d09e88abeb
2012-02-16 17:59:30 -08:00
Dianne Hackborn
621e2fecb5 Revert "Don't wait for current activity to pause before resuming next."
This reverts commit cbb722ed06092a9e2be37150aa8bc635f0fe21da.
2012-02-16 17:07:33 -08:00
Glenn Kasten
afe9833de9 Fixed possible heap corruption in EffectDesc
"EffectDesc *effect = new EffectDesc(*effects[i]);" was relying on the
default copy constructor for EffectDesc, but the default copy constructor
does a member-by-member copy.  This works OK for mUuid, but a member
copy of mName and mParams shares pointers.  This could result in heap
corruption later on due to a double free.  Changed to add an explicit
copy constructor that does a deep copy of both mName and mParams.

A malloc() and strdup() were being freed by delete, but the correct
matching API for these is free().  Fortunately our current memory runtime
implementation ignores the difference. Changed to use free().

EffectDesc and InputSourceDesc member fields were being torn down by
the code that does delete.  Changed to do the tear-down in ~EffectDesc()
and ~InputSourceDesc().

Added constructor EffectDesc() with name and UUID parameters, rather
than having caller fill in the object after construction.

Made ~EffectDesc() and ~InputSourceDesc() non-virtual to save memory,
since they have no subclasses.

Change-Id: Ibb5cc2e6760d72e0c4cf537068ac4432c717bafd
2012-02-16 16:57:44 -08:00
Amith Yamasani
3c3155abea Merge "Fix Power Control widget" 2012-02-16 15:48:14 -08:00
John Grossman
ba2ff9c223 Really fix the build this time.
Cannot try to include <limits> on git_master-without-vendor.  The file
just does not exist.

Change-Id: Iae383465c59d1cf59a9ba3f729f8f074971f7ce4
2012-02-16 15:25:51 -08:00
Amith Yamasani
67cf7d314b Fix Power Control widget
Some changes in AppWidgetService were interfering with widget permissions.

Added some hidden methods in Context to communicate the requesting user
information instead of using the calling uid.

Bug: 6019296
Change-Id: I5e519fd3fbbfa5b3fcc5c297b729c671dac8e7c7
2012-02-16 15:03:42 -08:00
John Grossman
b8525e9a76 Fix the build.
Looks like not all flavors of the android build include support for
std::numeric_limits.  Fix the build by using a simple macro for now.
A more elegant solution can be searched for once the build is green
again.

Change-Id: I18329cd0d26ca69de6a52df9a1c6eeb3ba063b48
2012-02-16 14:56:08 -08:00
John Grossman
4fbe95ede2 Fix a segfault in AudioFlinger.
Check the string returned by a HAL's implementation of get_parameters
for NULL before attempting to make use of it.  That way, we won't
bring down the mediaserver because of a poorly written HAL.

Change-Id: Ic99d7b004520d7d6347842a681c0595e889b68ea
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:12 -08:00
John Grossman
d8cf2960d0 Upintegrate Audio Flinger changes from ICS_AAH
Bring in changes to audio flinger made to support timed audio tracks
and HW master volume control.

Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:11 -08:00
John Grossman
c157673a59 Add the CommonTimeManagementService.
Add a small service to the high level core set of system services to
control the configuration of the native common time service.  This
service is responsible for controlling policy regarding when the
common time service should be allowed to run, which networks it is
allowed to run on, what priority it runs at in the master election
algorithm, and so on.

Change-Id: I1fcd834c0286aea0df9557520693a3f42de59d69
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:10 -08:00
Mike J. Chen
6c92951047 Upintegrate the common_time service from ics-aah.
Move the common_time service developed in the ics-aah branch back into
master.

The common_time service is a small service build to synchronize an
arbitrary timeline amongst peers on a local sub-net.  While running
and configured, the service will elect a master from the set of
available devices within the subnet, define a relationship between the
common_time timeline the local time timeline (provided by the local
time HAL), and then attempt to maintain synchronization between common
and local time by controlling the frequency of the local time clock
via the HAL, or by disciplining local time in the digital domain if
the local time HAL implementation does not support HW slewing.

On its own, the native common time service will do nothing until it is
configured.  The CommonTimeManagementService (running out of the
system server process) is responsible for implementing policy
regarding configuration and operation of the common_time service and
will be added in a subsequent CL.

Change-Id: I71292f9b9b1797665865689c4572c9d3a0552f64
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:10 -08:00
Svetoslav Ganov
cb46d80d21 Merge "Adding shell commands for modifying content." 2012-02-16 13:06:29 -08:00
Jeff Brown
4a06c8008b Simplify Choreographer API.
Removed the listeners and schedule animation / draw methods.
Instead all requests are posted as one-shot callbacks, which is a
better match for how clients actually use the Choreographer.

Bug: 5721047
Change-Id: I113180b2713a300e4444d0d987f52b8157b7ac15
2012-02-15 15:06:01 -08:00
Svetoslav Ganov
25872aa3ef Adding shell commands for modifying content.
1. Added methods to the ActivityManagerService remote interface
   that allow accessing content providers outside of an application.
   These methods are guarded by an internal signature protected
   permission which is given to the shell user. This enables a
   shell program to access content providers.

2. Implemented a shell command that takes as input as standart
   fagls with values and manipulates content via the content provider
   mechanism.

Change-Id: I2943f8b59fbab33eb623458fa01ea61a077b9845
2012-02-15 14:55:47 -08:00
Jeff Brown
91ec0b722f Merge "Clean up InputChannel file descriptor data type." 2012-02-14 17:11:41 -08:00
Amith Yamasani
ea555e2740 Merge "Mixed up uid and user-id." 2012-02-14 16:12:27 -08:00
Amith Yamasani
c600e21ffc Mixed up uid and user-id.
1000 is not a userId !

Potential fix for #5990664,#6008692

Change-Id: I528e742e494bc24beef7b59ccb315b7a5d4e84fe
2012-02-14 16:08:07 -08:00
Jeff Brown
91e328984c Clean up InputChannel file descriptor data type.
File descriptors are ints.

Change-Id: Ie36733bf36ddfeaa9a09ef6ebd7bd2f1788f5d27
2012-02-14 15:57:59 -08:00
Robert Greenwalt
7874efeb13 am c8711ca7: Merge "Stop using shared DUN APN when tethering stops." into ics-mr1
* commit 'c8711ca7eb962072ccd6175be3cfa861195ba6cd':
  Stop using shared DUN APN when tethering stops.
2012-02-14 13:41:47 -08:00
Mike Lockwood
ef9d55a6b0 am 8f7cc7af: am b9be8eff: am ffc89899: Merge "Don\'t pulse LED on new notification unless notification has LED flag set" into ics-mr1
* commit '8f7cc7af66520e3bd5e59e8eadb6907e3e043661':
  Don't pulse LED on new notification unless notification has LED flag set
2012-02-14 13:08:01 -08:00
Mike Lockwood
b9be8eff22 am ffc89899: Merge "Don\'t pulse LED on new notification unless notification has LED flag set" into ics-mr1
* commit 'ffc89899652f5c815b6d156f55a909001420891e':
  Don't pulse LED on new notification unless notification has LED flag set
2012-02-14 12:37:16 -08:00
Robert Greenwalt
2384386f31 Stop using shared DUN APN when tethering stops.
Backported from master, including a bug fix and a cdma enhancement.

Even if other people are sharing the connection (ie, carrier wants
default and tethered traffic on the same APN) stop using a carrier-
described APN when the tethering stops.

bug:5972599
Change-Id: I25e4831855e6b62c0c3ab3a6f4d4846aaee6ac50
2012-02-14 11:44:09 -08:00
Glenn Kasten
05bd19f608 Merge "Fix races related to volume and mute" 2012-02-14 09:44:47 -08:00
Glenn Kasten
4f7adcf76a Merge "Update comments" 2012-02-14 09:42:32 -08:00
Glenn Kasten
b3db213eb5 Update comments
We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
2012-02-14 09:17:59 -08:00
Glenn Kasten
150d238f3a Use size_t and ssize_t with Vector
Use size_t with size() and ssize_t with indexOfKey().  Exception:
use ssize_t for backwards loops, and indices that are overloaded as a
marker or error code.

Change-Id: Ibf2a360af4539b72b09c818dda22ea2a0de92431
2012-02-14 09:06:20 -08:00
Glenn Kasten
6a20b26d99 AudioRecord and AudioTrack client tid
Inform AudioFlinger of the tid of the callback thread.

Change-Id: I670df92dd06749b057238b48ed1094b13aab720b
2012-02-14 07:30:48 -08:00
Mike Lockwood
ece18efb35 Don't pulse LED on new notification unless notification has LED flag set
Bug: 6006131

Change-Id: I719c7d68e310bfaca227f6286159b3993784926b
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-13 20:42:19 -08:00
Jeff Brown
dc38fd4c73 Merge "Don't serialize motion events." 2012-02-13 15:04:33 -08:00