8368 Commits

Author SHA1 Message Date
Glenn Kasten
f64dfccd96 Merge "Unlock effect chains in the middle of two if's" 2012-02-28 07:23:42 -08:00
Glenn Kasten
c2dc1c4e57 Merge "Simplify removeNotificationClient" 2012-02-28 07:21:51 -08:00
Glenn Kasten
eb70fe50dd Merge "AudioFlinger const methods and parameters" 2012-02-28 07:21:09 -08:00
Glenn Kasten
0d07b6a55f Merge "Fix theoretical race condition in addOutputTrack" 2012-02-28 07:18:27 -08:00
Glenn Kasten
2b119a6336 Merge "AudioBufferProvider comments and cleanup" 2012-02-28 07:17:47 -08:00
satok
4e713f1441 Unblock IPC call in TextServicesManagerService
Bug: 5471520
Change-Id: Iedf2c2cdd8d4834545d06d72ade3ce211b104b1d
2012-02-28 17:00:46 +09:00
Mathias Agopian
aac99487a1 Merge "a window could get stuck to gpu composition" 2012-02-27 19:48:36 -08:00
Jim Miller
92e66dd683 Fix 5797764: don't hold PowerManager lock when changing native brightness
This fixes a bug where the device could see a priority inversion when
updating display brightness.  The problem occurs because the code that
manages screen brightness holds the master lock while waiting for the
native method to complete.  On some devices, each call can amount to
tens to hundreds of ms, which meant clients using PowerManager APIs
could block for the duration of the call.  In some cases, the animation
could block for many seconds because the unfairness of Java locks.

The solution is to handle all brightness updates in a separate thread that
does not hold the master lock while calling native methods.

This also makes the animation more consistent by animating by actual
wall clock time rather than depending on the round-trip from the driver.

Change-Id: Ifad76fb2fb77e7b2a72dd9150440d87e22581b40
2012-02-27 18:31:03 -08:00
Jamie Gennis
a85ca37c84 Add tracing to various graphics components.
This change adds ATRACE call tracing to BufferQueue,
SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL.

Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
2012-02-27 17:50:35 -08:00
Dave Burke
e5c484cb55 Merge "Increase max size of log size by 50% on userdebug builds." 2012-02-27 17:01:38 -08:00
Mathias Agopian
7df03c067d a window could get stuck to gpu composition
this could happen after an orientation change. basically
we need to triger a geometry-changed when the very first buffer
is received

Change-Id: I097e411fd6612c18725737cffccdbf6b2af3511c
2012-02-27 16:58:04 -08:00
Dave Burke
0132a952f7 Increase max size of log size by 50% on userdebug builds.
Useful especially for last kmsg (e.g. IMG/DSS logs truncate
and loose useful info). Since this is a max, won't affect files
that are already shorter than 64kb.

Change-Id: Ia5bb178678067e69384285e8c338dc8cb6ad071b
2012-02-27 16:46:38 -08:00
Craig Mautner
41c31ef3fa Merge "Fix bug introduced when moving animation step out from between assignments to wasAnimating and nowAnimating. Now wasAnimating once again contains the animation state prior to the animation step." 2012-02-27 16:28:15 -08:00
Craig Mautner
83eaab5b43 Fix bug introduced when moving animation step out from between assignments to wasAnimating and nowAnimating.
Now wasAnimating once again contains the animation state prior to the animation step.

Change-Id: I2b53bd3f62228183233ab36f0ebe44c0344d2351
2012-02-27 16:15:13 -08:00
Selim Gurun
84c00c67d7 Prevent potential stall in dns proxy.
Reflect the changes in ResponseCode.h to corresponding java file.

Change-Id: I6d536aa4942bb4bd9db5df97895467fcdb4786ca
2012-02-27 15:42:38 -08:00
Glenn Kasten
fa28f57f29 Merge "Fix tracking of hardware state for dump" 2012-02-27 13:23:51 -08:00
Mathias Agopian
8335f1cccc fix libgui header location
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-27 13:03:08 -08:00
Glenn Kasten
40ba9cddea Merge "Make threadLoop() logs identical" 2012-02-27 07:24:46 -08:00
Glenn Kasten
db316b212f Merge "Move declaration of mixerStatus to inner block" 2012-02-27 07:21:00 -08:00
Mathias Agopian
018549e4bf Merge "remove dependency on android_native{s_priv|buffer}.h" 2012-02-24 19:08:12 -08:00
Dianne Hackborn
5265466e8a Merge "New development permissions." 2012-02-24 18:40:37 -08:00
Mathias Agopian
af01feafc3 remove dependency on android_native{s_priv|buffer}.h
Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
2012-02-24 18:26:01 -08:00
Glenn Kasten
538529b9dc Simplify removeNotificationClient
No need to check for presence of item before removing
(but we do lose the log of the previous value).

Change-Id: I2838430824de5f257f2ee15db0c22b1920c67d08
2012-02-24 17:00:30 -08:00
Mathias Agopian
f9c83f3763 Merge "remove libui dependency on libEGL" 2012-02-24 16:44:40 -08:00
Mathias Agopian
cc0eaa6582 remove libui dependency on libEGL
Change-Id: I1194f04085637d5c384e134967249430cc43b6ee
2012-02-24 16:42:46 -08:00
Glenn Kasten
0fccd35b32 AudioFlinger const methods and parameters
Change-Id: I93ec28024005ed23aa141518092a012a4a7c44c5
2012-02-24 16:34:43 -08:00
Glenn Kasten
3be2bc08ee Make threadLoop() logs identical
Change the wording of the logs in the various copies of threadLoop()
to be identical.  This will make it easier to merge them soon.

Change-Id: Idfa181e437738712c784dc7f746cac79f83d2931
2012-02-24 16:26:07 -08:00
Glenn Kasten
26debac448 Move declaration of mixerStatus to inner block
mixerStatus was being declared (and initialized) too early,
which also resulted in a duplicate initialization.  Moved
the declaration into the block where it is actually used.

Change-Id: Ifdcfefe362a5efe3493dd616cdb44645c6f9aed5
2012-02-24 16:14:46 -08:00
Glenn Kasten
2521a01970 Pull out duplicated copies of silent mode check
Also fix the error handling for the property_get.

This is part of preparation for the threadLoop() merge.

Change-Id: I6405190ea18146d1271575e1dfe9f279e8f36b17
2012-02-24 16:02:24 -08:00
Glenn Kasten
e20ab3811a Unlock effect chains in the middle of two if's
As part of the upcoming threadLoop() merge, this CL makes it clearer
what are the similar and different parts before and after unlocking
effect chains.

In each threadLoop(), the old code was:

    if (sleepTime == 0) {
        // A
        unlockEffectChains(effectChains);
        // B
    } else {
        unlockEffectChains(effectChains);
        // C
    }

The new code is:

    if (sleepTime == 0) {
        // A
    }
    unlockEffectChains(effectChains);
    if (sleepTime == 0) {
        // B
    } else {
        // C
    }

Also this is slightly slower by one "if", it has the advantage of making
it much more obvious about what is done before and after the unlock,
and also to see the similarities and differences among the various
copies of threadLoop().

Change-Id: I7bf4369d2dcb072573ec43b7e52c637f0097dc00
2012-02-24 15:55:08 -08:00
Dianne Hackborn
0aec3ea6de am 911b505f: am dc5fa185: am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" into ics-mr1
* commit '911b505f11c719906985f169a4f45930bdec8695':
  Fix issue #6048808: sometimes auto-correct is inactive
2012-02-24 15:44:55 -08:00
Dianne Hackborn
dc5fa1859d am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" into ics-mr1
* commit '133dc2d7aecc68990c363c861716b134910a4ced':
  Fix issue #6048808: sometimes auto-correct is inactive
2012-02-24 15:38:07 -08:00
Mathias Agopian
7b49b4bea8 Merge "deprecate L_8, LA_88 and RGB_332 in sdk" 2012-02-24 15:09:54 -08:00
Mathias Agopian
e9d4c71f47 deprecate L_8, LA_88 and RGB_332 in sdk
re-add support for pixelformats L_8, LA_88 and RGB_332 in libui
for backward compatibility.

This may or may not fix 6058926

Bug: 6049685
Change-Id: Ic1b8b4cc994522f7fe664da64c0ef76b98bc6d53
2012-02-24 14:58:36 -08:00
Glenn Kasten
baad42e3a3 Merge "Pull CPU statistics code out of threadLoop()" 2012-02-24 14:25:15 -08:00
Glenn Kasten
91540aeb6c Fix theoretical race condition in addOutputTrack
This is not a real race, because addOutputTrack was only called in two
places, and in both places there could be no other threads referencing
the DuplicatingThread instance.

Those two places are:
 - the DuplicatingThread constructor, which is of course safe
 - openDuplicateOutput - this is safe because it's called immediately
   after the new DuplicatingThread, and there are no sp<> either in the
   constructor or here which could cause onFirstRef() to do Thread::run().

But for safety in case addOutputTrack is ever called somewhere else,
or there are sp<> created earlier, it is safer to take the thread lock.

Change-Id: I1502d014fa37ec5dbf4bf40d3e2884af311cd5e9
2012-02-24 14:20:29 -08:00
Glenn Kasten
6ec27552a0 Pull CPU statistics code out of threadLoop()
This is to prepare for the threadLoop() merge

Change-Id: I118c7d5c6b011b5d5b95ec7d63fb03feb166a9cf
2012-02-24 13:56:12 -08:00
Glenn Kasten
c2db119d0a AudioBufferProvider comments and cleanup
Add comments about which methods implement the AudioBufferProvider interface.

Simplified the definition of kInvalidPts.  <stdint.h> is very hard to work
with, there seems to be no way to use it reliably to get INT64_MAX without
having a separate source file, which is ugly because it means kInvalidPts
is not a compile-time constant.  So I just deleted AudioBufferProvider.cpp
and used a hard-coded constant instead.

Added a default constructor for Buffer so that the fields aren't random
(especially .raw which is used to determine if the buffer is valid).

Make the pts for getNextBuffer default to kInvalidPTS so code that
doesn't need a pts doesn't have to specify a value.

Rename the parameter to AudioMixer::setBufferProvider to make it clearer.

Change-Id: I87e7290884d4ed975b019f62d1ab6ae2bc5065a5
2012-02-24 13:42:13 -08:00
Glenn Kasten
23c9c74017 Fix tracking of hardware state for dump
At end of AudioFlinger::onFirstRef(), the hardware status was being left
in wrong state.  It should be AUDIO_HW_IDLE but was AUDIO_HW_INIT.

mHardwareStatus was being set to AUDIO_HW_OUTPUT_OPEN too early, and so
a return would leave it in the wrong state until next hardware operation.

Take the hardware lock for dev->get_parameters, and update mHardwareStatus
before and after.

Keep hardware lock only for the duration of the dev->set_parameters.

Rename two constants in enum hardware_call_state to have the prefix
AUDIO_HW so they follow the naming conventions.

Add comments.

Change-Id: I6c7450b11f9b13adaeef9cec874333e478a58fc0
2012-02-24 13:31:26 -08:00
Dianne Hackborn
7663d80f6b Fix issue #6048808: sometimes auto-correct is inactive
My previous change to speed up the time the IME is dismissed was
fundamentally flawed.  That change basically switched the order
the application called the input method manager service from doing
startInput() and then windowGainedFocus(), to first windowGainedFocus()
and then startInput().

The problem is that the service relies on startInput() being done
first, since this is the mechanism to set up the new input focus,
and windowGainedFocus() is just updating the IME visibility state
after that is done.  However, by doing the startInput() first, that
means in the case where we are going to hide the IME we must first
wait for the IME to re-initialize editing on whatever input has
focus in the new window.

To address this, the change here tries to find a half-way point
between the two.  We now do startInput() after windowGainedFocus()
only when this will result in the window being hidden.

It is not as easy as that, though, because these are calls on to
the system service from the application.  So being able to do that
meant a fair amount of re-arranging of this part of the protocol
with the service.  Now windowGainedFocus() is called with all of
the information also needed for startInput(), and takes care of
performing both operations.  The client-side code is correspondingly
rearranged so that the guts of it where startInput() is called can
instead call the windowGainedFocus() entry if appropriate.

So...  in theory this is safer than the previous change, since it
should not be impacting the behavior as much.  In practice, however,
we are touching and re-arranging a lot more code, and "should" is
not a promise.

Change-Id: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
2012-02-24 13:18:23 -08:00
Glenn Kasten
d366515421 Merge "Remove TrackBase::mFlags" 2012-02-24 13:17:36 -08:00
Glenn Kasten
3526982c1d Remove TrackBase::mFlags
The bit-field TrackBase::mFlags was supposed to have track-specific
flags in the upper 16 bits, and system flags in the lower 16 bits.

The upper 16 bits of mFlags were initialized in the TrackBase
constructor from the flags parameter of IAudioFlinger::createTrack()
and IAudioFlinger::openRecord(), and the lower 16 bits were cleared.

However, the upper 16 bits of mFlags were never acccessed again.
So really there are no track-specific flags.  I left the flags
in the parameter list of createTrack() and openRecord() but made a
note that these should be removed eventually as they are dead.

This leaves only the one system flag "step server failed".  I replaced
the bit-field mFlags by bool mStepServerFailed, which is simpler and
slightly faster.

Change-Id: I6650f5487be72791b4a67d73adcd10ffa04e2aa5
2012-02-24 13:14:28 -08:00
Daniel Sandler
3f0c58eb70 Merge "New notification priority and related APIs." 2012-02-24 10:53:42 -08:00
Daniel Sandler
2561b0b10a New notification priority and related APIs.
This change introduces a few new bits of data on
Notification that will help the Notification Manager and
System UI route and display them more intelligently:

 -> priority: an integer in a predefined range that
    indicates the app's best guess as to the relative
    importance (to the user, right now) of that information

 -> kind: a tag (really, set of tags) indicating the general
    type of notification (realtime, asynchronous, etc)

 -> extras: a Bundle of additional key/value pairs
    associated with this notification (currently @hidden)

The notification manager takes these data into account when
assigning to each notification a score which is passed with
the notification on to the system UI, where it can be used to
affect presentation. For example:

  - Spammy apps (identified explicitly by the user or by
    some other means) will have their notifications scored
    very negatively by the notification manager, allowing
    the UI to suppress them
  - Notifications of higher score might be shown larger
    or in a different way
  - Very important notifications (indicated by a very high
    score) might interrupt the user during an otherwise
    important task (videochat, game, etc)

Implementation note: This replaces/extends the old internal
notion of "priority", which was mostly used to organize
ongoings and system notifications at the top of the panel.

Change-Id: Ie063dc75f198a68e2b5734a3aa0cacb5aba1ac39
2012-02-24 13:47:00 -05:00
Mathias Agopian
2d77b5332a Merge changes I97807db6,I7d350bc0
* changes:
  workaround for an issue where the screen would flicker sometimes
  fix an issue in SF where we could miss some updates
2012-02-23 21:23:02 -08:00
Mathias Agopian
6ea851fadf workaround for an issue where the screen would flicker sometimes
bug: 6020860
Change-Id: I97807db66b66c5f4dcbed0df79d5d257cfc7c0bd
2012-02-23 21:20:01 -08:00
Mathias Agopian
f37d8fcf05 fix an issue in SF where we could miss some updates
Change-Id: I7d350bc05d1596655baddff3deaebaba58c9bcc0
2012-02-23 21:17:01 -08:00
Svetoslav Ganov
42d840b91d Merge "Fixing issues with the AccessibilityNodeInfo cache." 2012-02-23 19:04:41 -08:00
Svetoslav Ganov
57c7fd5a43 Fixing issues with the AccessibilityNodeInfo cache.
1. Before there were two caches one in the app process that
   kept track only the ids of infos that were given to a
   querying client and one in the querying client that
   holds the infos. This design requires precise sync
   between the caches. Doing that is somehow complicated
   since the app has cache for each window and it has
   to intercept all accessibility events from that window
   to manage the cache. Each app has to have a cache for
   each querying client. This approach would guarantee that
   no infos are fetched twice but due to its stateful nature
   and the two caches is tricky to implement and adds
   unnecessary complexity. Now there is only one cache in
   the client and the apps are stateless. The client is
   passing flags to the app that are a clue what nodes to
   prefetch. This approach may occasionally fetch a node
   twice but it is considerably simpler and stateless
   from the app perspective - there is only one cache.
   Fetching a node more than once does not cause much
   overhead compared to the IPC.

Change-Id: Ia02f6fe4f82cff9a9c2e21f4a36747de0f414c6f
2012-02-23 18:51:04 -08:00
Dianne Hackborn
e639da7baa New development permissions.
These are permissions that an application can request, but won't
normally be granted.  To have the permission granted, the user
must explicitly do so through a new "adb shell pm grant" command.

I put these permissions in the "development tools" permission
group.  Looking at the stuff there, I think all of the permissions
we already had in that group should be turned to development
permissions; I don't think any of them are protecting public APIs,
and they are really not things normal applications should use.

The support this, the protectionLevel of a permission has been
modified to consist of a base protection type with additional
flags.  The signatureOrSystem permission has thus been converted
to a signature base type with a new "system" flag; you can use
"system" and/or "dangerous" flags with signature permissions as
desired.

The permissions UI has been updated to understand these new types
of permissions and know when to display them.  Along with doing
that, it also now shows you which permissions are new when updating
an existing application.

This also starts laying the ground-work for "optional" permissions
(which development permissions are a certain specialized form of).
Completing that work requires some more features in the package
manager to understand generic optional permissions (having a
facility to not apply them when installing), along with the
appropriate UI for the app and user to manage those permissions.

Change-Id: I6571785c6bb5f6b291862b7a9be584885f88f3a5
2012-02-23 16:39:15 -08:00