8244 Commits

Author SHA1 Message Date
Glenn Kasten
eabd94aa7d AudioFlinger methods const and inline
This saves 1063 bytes and probably improves performance.

Change-Id: I11cf0dfd925fbaec75e3d1b806852a538eae5518
2012-02-03 15:25:24 -08:00
Jeff Sharkey
241dde2306 Unify shorthand for byte-based units.
Change-Id: If990859dee3f0973e1d4c48f05312c84071b3328
2012-02-03 14:50:13 -08:00
Glenn Kasten
b16313812a Use virtual destructors
It turns out to be just a comment, as all except AudioMixer are RefBase.

There are only a few performance-sensitive cases where it's worth thinking
about whether you need a virtual destructor, and the headache usually
outweighs the benefit.

Change-Id: I716292f9556ec17c29ce8c76ac8ae602cb496533
2012-02-03 14:42:43 -08:00
Amith Yamasani
1ef7d13172 Merge "Multi-user - 1st major checkin" 2012-02-03 12:04:40 -08:00
Amith Yamasani
742a671273 Multi-user - 1st major checkin
Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
2012-02-03 12:01:47 -08:00
Glenn Kasten
706b618c12 Use 0 not NULL for sp<> and wp<>
Change-Id: Id1f0c89acefaceed6cb9ca7c165fce895e46d85b
2012-02-03 11:20:35 -08:00
Robert Greenwalt
06e601f91b Merge "Add some logging to NDC." 2012-02-03 08:54:02 -08:00
Glenn Kasten
f55bc56490 Merge "Use audio_in_acoustics_t consistently" 2012-02-03 08:31:01 -08:00
Glenn Kasten
191c849283 Merge "Use ToneGenerator::tone_type consistently" 2012-02-03 08:00:52 -08:00
Glenn Kasten
3694ec1f19 Use NULL not 0 for raw pointers
Use if (p != NULL) instead of if (ptr)

Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
2012-02-03 07:57:01 -08:00
Glenn Kasten
7bd4f6f4d0 Merge "For performance, return large objects by reference" 2012-02-03 07:46:42 -08:00
Glenn Kasten
22152a6807 Merge "No need to check a wp<> for 0 before promote()" 2012-02-03 07:45:13 -08:00
Glenn Kasten
dc3ac85009 Constructor initialization and const fields
In constructors, initialize member fields in the initialization list
rather than constructor body where possible.  This allows more fields
to be const, provided they are never modified.

Also initialize POD fields in constructor, unless it's obvious they
don't need to be initialized.  In that case, put a comment instead.

Remove explicit clear() in destructors on fields that are now const.

Give AudioSessionRef a default constructor, so it's immutable fields can
be marked const.

Add comment about ~TrackBase() trick.

Initialize fields in declaration order to make it easier to confirm that
all fields are set.

Move initialization of mHardwareStatus from onFirstRef() to constructor.

Use NULL not 0 to initialize raw pointers in initialization list.

Rename field mClient to mAudioFlingerClient, and getter from client()
to audioFlingerClient().

Change-Id: Ib36cf6ed32f3cd19003f40a5d84046eb4c122052
2012-02-03 07:37:14 -08:00
Glenn Kasten
a12b6d1d44 Merge "Cleanup thread types" 2012-02-03 07:26:28 -08:00
Glenn Kasten
08d5eb9885 Merge "Make AudioTrack control block volume field private" 2012-02-03 07:18:06 -08:00
Robert Greenwalt
f0be1d89bf Add some logging to NDC.
We're getting some lockups of netd and this can help point us
in the right direction.

bug:5864209
Change-Id: Id8bdb0a758c5b161e0143de61b5f39c3a982e329
2012-02-02 16:38:38 -08:00
Mathias Agopian
b545eaa9cb Merge "separate transactions from updates" 2012-02-02 16:28:05 -08:00
Mathias Agopian
5122453f9c Merge "fix an issue where SF would spin if /sys/power/wait_for_fb_xxx don't exist" 2012-02-02 16:27:37 -08:00
Jeff Sharkey
34c4d2e249 Merge "Support snoozing of data warning notification." 2012-02-02 16:26:41 -08:00
Jeff Sharkey
0e2e5f8b56 Support snoozing of data warning notification.
Introduce second snooze timestamp to support dismissal of data usage
warning notification.  Also explicitly set notification "when" to
avoid fighting with other notifications, such as ongoing downloads.

Bug: 5443756, 5262414
Change-Id: I03342c25b0410b1b2db84de9a40884f04cb1d8ae
2012-02-02 16:22:33 -08:00
Mathias Agopian
deb1e6c6e5 fix an issue where SF would spin if /sys/power/wait_for_fb_xxx don't exist
we now exit the Display thread on any error happening on these files.
also refactor the code and remove a lot of unused stuff.

Change-Id: I8d080c35b211890ca20ae09fa36fbdccdf5669a8
2012-02-02 16:20:27 -08:00
Glenn Kasten
b2305815f0 Merge "Fix const sp<>& in parameter list and return value" 2012-02-02 13:31:23 -08:00
Glenn Kasten
225400f710 Merge "Unconditional delete" 2012-02-02 13:30:48 -08:00
Jeff Sharkey
2c5674aa7b Merge "Avoid NDC deadlock when re-arming network alert." 2012-02-02 13:19:37 -08:00
Jeff Sharkey
25ce9ed57f Avoid NDC deadlock when re-arming network alert.
When NDC delivers limitReached() event, NMS re-arms the alert, which
makes another call back to NDC.  If NDC already started processing
another call, this causes deadlock.

Fix this by re-arming on a handler thread.

Bug: 5879848
Change-Id: I46fa78fe1f1122c5f31dd6020483e5ae89a9f39d
2012-02-02 13:09:52 -08:00
Chet Haase
659793bcd0 Merge "Add Developer Option setting for Animator scaling." 2012-02-02 10:42:44 -08:00
Chet Haase
c38fa1f636 Add Developer Option setting for Animator scaling.
This new setting allows users to set a scale factor for the
duration and startDelay of all Animator-based animations. This
setting is very similar to the Transition animation scale and
Window animation scale settings, except this one applies specifically
to Animator animations. The property is only accessible by users
through the Settings UI, not programmatically. The value applies
system-wide and is picked up per-process at the time of the first
ValueAnimator construction.

This is an update to a previous CL; this approach uses the WindowManager
to store the animator scale settings, instead of SystemProperties.

Change-Id: I8295fab060aa6d597ae507ded8f9c9d6077be966
2012-02-02 08:40:44 -08:00
Mathias Agopian
9a9dbd5921 separate transactions from updates
with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
2012-02-01 20:43:06 -08:00
Dianne Hackborn
8bcd54b98a Use Choreographer for window manager animation timing.
Change-Id: Ic34aff698c63d383ecd06af7da9957475683a1db
2012-02-01 16:02:14 -08:00
Christopher Tate
f46723b41f Implement background vs foreground broadcasts
Before now, receiving a broadcast would cause a process to be hoisted
to foreground priority / cgroup.  This is no longer the case: broadcasts
by default are handled in the background, with a suitably increased
timeout interval.  When a given broadcast needs to be dealt with in a
more timely manner, the issuer can set the new FLAG_BROADCAST_FOREGROUND
flag on the Intent, which will produce the old foreground-priority
behavior.

To avoid priority inversions, foreground broadcasts are tracked on a
separate outgoing queue and can be in flight simultaneously with a
background-priority broadcast.  If there is already a background-level
broadcast in flight to a given app and then a foreground-level one is
dispatched to that app, the app [and its handling of both broadcasts]
will be properly hoisted to foreground priority.

This change is also essentially the first step towards refactoring the
broadcast-handling portions of the Activity Manager into a more
independent existence.  Making BroadcastQueue a top-level class and
regularizing its operation viz the primary Activity Manager operation
is the next step.

Change-Id: If1be33156dc22dcce318edbb5846b08df8e7bed5
2012-02-01 14:36:34 -08:00
Svetoslav Ganov
2eecea3b48 Merge "Speedup the accessibility window querying APIs and clean up." 2012-02-01 13:45:24 -08:00
Jeff Sharkey
02f134aafd Merge "Clear identity when updating network stats." 2012-01-31 17:14:14 -08:00
Jeff Sharkey
e630f7b31b Clear identity when updating network stats.
Bug: 5945461
Change-Id: Ie51ea3f107a705c395b65684f21bf4c28c7f4d33
2012-01-31 17:13:09 -08:00
Mathias Agopian
dcaf1adcb6 Merge "fix an issue with vsync event delivery" 2012-01-31 16:46:27 -08:00
Mathias Agopian
58737fe96d fix an issue with vsync event delivery
vsync events were sometimes delivered to connected
client who didn't request them. this happened if
another client requested the delivery and that client
was first in the client list.

also fix the vsync test which didn't request any events as
well as DisplayEventReveiver documentation which was misleading
about the necessity to request vsync events.

Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686
2012-01-31 16:42:54 -08:00
Mathias Agopian
b17932fe84 Merge "Nexus S now reports the proper frame-rate" 2012-01-31 15:54:20 -08:00
Jeff Brown
ed73440416 Merge "Use O_CLOEXEC when opening input device." 2012-01-31 10:05:51 -08:00
Jeff Brown
dd3ba43843 Merge "Add basic support for new suspend-block ioctls." 2012-01-31 10:05:09 -08:00
Mathias Agopian
007a34c27f Nexus S now reports the proper frame-rate
don't hardcode it.

Change-Id: I4b37f37a9809cac937e6334c988b3185af2ebe22
2012-01-30 18:45:15 -08:00
Mathias Agopian
7ff542c1ae Merge "SF now synchronizes to VSYNC" 2012-01-30 15:24:46 -08:00
Mathias Agopian
e02f7b3fa8 SF now synchronizes to VSYNC
Change-Id: Ic5e4f2ea9927ce133eef9499c03161325e9d02c5
2012-01-30 15:21:23 -08:00
Glenn Kasten
9704026ccb For performance, return large objects by reference
Change-Id: Ibf737018ef1d3c7d717584615dcb2d4ecdb50c99
2012-01-30 13:01:17 -08:00
Glenn Kasten
c64a6f01cb Improve performance for sp<> on stack
Combine default constructor for sp<> immediately followed by assignment,
as the reference-counting is relatively slow.  Also return sp<> directly
rather than via local variable, for the same reason.

Change-Id: If55931f1e407994f6591ddde41b53db72fb4fc40
2012-01-30 13:00:02 -08:00
Jeff Sharkey
5e61331da5 Move away from deprecated NetworkInfo extra.
Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast
extra does not reflect the state applicable to the calling UID, and
the last sticky broadcast may have stale state, transition to calling
ConnectivityManager.getActiveNetworkInfo() directly.

Change-Id: I86b316fbedd0273585ad5f1248b091bc3a3a5520
2012-01-30 11:21:35 -08:00
Glenn Kasten
1f812f720f Fix const sp<>& in parameter list and return value
EffectModule::addHandle and Client::heap() were declared incorrectly.

As a parameter, an sp<> should be & for efficiency, and for input
parameters it should also be const to protect the caller's value.

But as a return value, an sp<> should have neither const or &.  The "e"
in "return e;" might be located on the stack, and if there is "&" then
the caller would see the address of a variable which no longer exists.
Also, an & would make it hard to do "return 0;".
A "const" without & is meaningless in the return type.
(In this particular case, the "e" is a member field, so it was safe.)

Change-Id: I3df5f294214eb15a9d4d596c6d5ef29de97b5c27
2012-01-30 10:31:09 -08:00
Mathias Agopian
acabf48867 remove unneeded code
Change-Id: I07e2fca7274d2e12bf5b4aee0050794bdb97a8b3
2012-01-29 23:11:06 -08:00
Mathias Agopian
c0e32a47d5 Merge "added a few more commands to SF's dumpsys" 2012-01-29 22:02:36 -08:00
Mathias Agopian
8d1b5e3c0b added a few more commands to SF's dumpsys
--latency-clear [name]
clears the latency data for the specified layer or for
all layers if none is specified

--list
prints the list of all layers regardless of their visibility

Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
2012-01-28 22:31:55 -08:00
Glenn Kasten
2589cf9c6a Unconditional delete
Don't check that pointer is non-NULL before delete.

Don't leave deleted member fields non-NULL, except in a destructor,
since it could be misleading in a dump or debugger. (mRsmpOutBuffer)

Change-Id: Ic0492a6b752f74a67f4c96dfb89ca2de4e69eecf
2012-01-27 18:08:45 -08:00
Jeff Brown
cb0af4f1b0 Merge "Improve watchdog monitor for InputReader and InputDispatcher." 2012-01-27 17:37:31 -08:00