8368 Commits

Author SHA1 Message Date
Dianne Hackborn
b8678d76c3 resolved conflicts for merge of 210c1a26 to master
Change-Id: Ic44193e62215086c22225f2def5eee3159d26ae8
2012-02-23 10:54:06 -08:00
Glenn Kasten
3bf96c9c9a Merge "Avoid wp<>::unsafe_get() with a few exceptions" 2012-02-22 13:22:13 -08:00
Glenn Kasten
685c9ce3bd Avoid wp<>::unsafe_get() with a few exceptions
Avoid using wp<>::unsafe_get() except in a log, and other specific cases
when it's known to be safe.

Use more specific subclass types for parameters to avoid down-casts.

When a constructor or method parameter is "this" of an object that is
currently being constructed, it's better to use a raw pointer rather
than either sp<> or wp<>.

Using the raw pointer is safe, provided either:
 - it is "this" of an object being constructed (which has sp<> refcount of 0),
 - or the caller already holds an sp<>

The raw pointer is simpler and faster, and it avoids the problem of the
sp<> reference count being incremented and then decremented to zero on
scope exit, which would cause the object's destructor to run while the
object is still being constructed.

Also removed some dead code per a review comment.

Change-Id: I7375f64da3aec11b928c33cb01faff186252ef5e
2012-02-22 13:19:26 -08:00
Glenn Kasten
8c5ecd6af5 Merge "Fix build warning" 2012-02-22 13:14:50 -08:00
Glenn Kasten
175b2be791 Fix build warning
warning: pointer of type 'void *' used in arithmetic
warning: enumeral and non-enumeral type in conditional expression

Change-Id: I7b8d626a636145ef648e3b5d0e77068216dd012e
2012-02-22 11:46:53 -08:00
Craig Mautner
5489e4af19 Merge "- 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." 2012-02-22 07:53:43 -08:00
Svetoslav Ganov
a6cdf86518 Merge "Improving accessibility APIs used for UI automation." 2012-02-21 17:17:33 -08:00
Svetoslav Ganov
0d04e24553 Improving accessibility APIs used for UI automation.
1. UiTestAutomationBridge was accessing the root node in the
   active window by tracking the accessibility event stream
   and keeping the last active window changing event. Now
   the bridge is stateless and the root node is fetched by
   passing special window and view id with the request to
   the system.

2. AccessibilityNodeInfos that are cached were not finished,
   i.e. not sealed, causing exception when trying to access
   their children or rpedecessors.

3. AccessibilityManagerService was not properly restoring its
   state after the UI automation bridge disconnects from it.
   I particular the devices was still in explore by touch mode
   event if no services are enabled and the sutomation bridge
   is disconnected.

4. ViewRootImpl for the focused window now fires accessibility
   events when accessibility is enabled to allow accessibility
   services to determine the current user location.

5. Several missing null checks in ViewRootImpl are fixed since
   there were scenraios in which a NPE can occur.

6. Update the internal window content querying tests.

7. ViewRootImpl was firing one extra focus event.
bug:6009813
bug:6026952

Change-Id: Ib2e058d64538ecc268f9ef7a8f36ead047868a05
2012-02-21 17:09:09 -08:00
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