8292 Commits

Author SHA1 Message Date
Glenn Kasten
7ed4f0c7f1 Fix typos in ALOG for pid vs tid
Change-Id: I6dc70f137d0ff8a86427ab8882a81886e1de0782
2012-02-09 16:33:17 -08:00
Glenn Kasten
c93dd55877 createSurface getpid() first parameter was removed
Most of these tests in this directory don't currently build,
but test-surface did build incorrectly by bad luck, using the old API.
test-resize still doesn't build, but when the other build errors
are fixed then it will use the right API.

Change-Id: I388d6d59fe0a2328f352214dcdc28839a24043f0
2012-02-09 14:34:15 -08:00
Dianne Hackborn
a0c283eac3 Add new feature for running services in "isolated" sandbox processes.
This reserves a range of uids (for each user) in which these processes
run.  These uids are not associated with an application, so they
effectively run with no permissions.  When a Service requests to
run in such a process through android:isolatedProcess="true", each
time it is brought up a new isolated process is started with its
own unique uid.

What we have so far gives us the basic infrastructure; more work
remains to further lock down what these uids have access to.

Change-Id: Ibfd27c75619cba61f528f46ede9113f98dc5f45b
2012-02-09 11:18:33 -08:00
Glenn Kasten
0765c448ab No newline or space at end of ALOG format string
Change-Id: I0bef580cbc818cb7c87aea23919d26f1446cec32
2012-02-08 17:21:49 -08:00
Glenn Kasten
8b02b99434 Fix races related to volume and mute
Fix race conditions when setting master volume, master mute, stream
volume, stream mute for a playback thread, and when reading stream
volume of a playback thread.  Lock order is AudioFlinger, then thread.

Rename streamVolumeInternal to streamVolume_l, comment, and use it to
implement streamVolume().

Code size reduction:
 - Remove dead code: AudioFlinger::PlaybackThread::masterVolume, masterMute, streamMute.
 - Change return type of non-binder methods that always succeed from status_t to void.
 - Remove virtual from volume and mute methods that don't need it.

This change saves 228 bytes but decreases performance of binder operations
due to the added locks.

Change-Id: Iac75abc1f54784873a667d1981b2e08f8f31e5c9
2012-02-08 17:01:49 -08:00
Marco Nelissen
de7408c94e Fix "dumpsys activity provider"
Change-Id: Ic0678a6edb539bb5648529dd9c38a382bc9cc3fb
2012-02-08 14:57:38 -08:00
Glenn Kasten
3773334fbd Move declaration of stream_type_t up earlier
stream_type_t is used by AudioFlinger class, so it should be declared there.
This way we don't have to peek into PlaybackThread to get the declaration.

Change-Id: Ie08bab1604699214d1e8df2d48d3fbfbbc436e96
2012-02-08 12:54:31 -08:00
Glenn Kasten
aae26c8de4 Rename type() to streamType()
This avoids possible confusion with thread's type().
Also remove redundant cast "(audio_stream_type_t)".

Change-Id: I320b9177b6c267a102d215f002228bcf988c437a
2012-02-08 12:52:00 -08:00
Dianne Hackborn
f6a7e1f7cd Merge "Don't wait for current activity to pause before resuming next." 2012-02-08 11:38:23 -08:00
Glenn Kasten
803a86a546 Combine duplicate code & document wp<> in mClients
Change-Id: Iea8cfe8e57563337fb2484a1246ef79d6ad3db18
2012-02-08 10:24:54 -08:00
Glenn Kasten
39d00cb442 Use audio_io_handle_t consistently instead of int
Other:
 - add a comment to nextUniqueId
 - made ThreadBase::mId const, since it is only assigned in constructor.

Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837
2012-02-08 10:06:32 -08:00
Glenn Kasten
f31d05007c Simplify destructors
Remove explicit clear() when the order doesn't matter.

Change-Id: I5931bc7ef5f681c7ce329aa9ec0a6e46d34a56c5
2012-02-08 09:49:14 -08:00
Glenn Kasten
6731333584 Effect UUID inputs passed by pointer are const
Change-Id: I1f5c338bcb7368e3dd8cd5f804b2e6d9fbe087f8
2012-02-08 09:21:39 -08:00
Glenn Kasten
a5a6580d17 Merge "Use pid_t not int" 2012-02-08 08:40:28 -08:00
Glenn Kasten
1b33107f37 Merge "Don't double destruct audio_track_cblk_t" 2012-02-08 08:40:15 -08:00
Glenn Kasten
cd330e7f38 Merge "AudioFlinger methods const and inline" 2012-02-08 08:39:39 -08:00
Glenn Kasten
cbe8b72247 Merge "Use virtual destructors" 2012-02-08 08:33:41 -08:00
Glenn Kasten
2277665266 Merge "Improve performance for sp<> on stack" 2012-02-08 07:45:15 -08:00
Glenn Kasten
01a802692f Merge "Use 0 not NULL for sp<> and wp<>" 2012-02-08 07:41:44 -08:00
Glenn Kasten
35624c1797 Merge "Use bool instead of int" 2012-02-08 07:40:23 -08:00
Glenn Kasten
16d64ad699 Merge "Declare more IAudioFlinger methods const" 2012-02-08 07:39:27 -08:00
Glenn Kasten
e0efd5f6c1 Merge "Remove dead code" 2012-02-08 07:38:42 -08:00
Guang Zhu
6ffa76077d Revert "Make NDC not block forever and handle restart."
Reverting because it seems to break `adb reboot`

This reverts commit 813af8d46467f41ed2d492917cbb9f9f45d2a3d7.

Change-Id: I75d827664a08799de15369c24c84cc3f49a8f297
2012-02-07 19:25:42 -08:00
Jeff Brown
308028049a Remove the input dispatcher throttle.
This is part of a series of changes to improve input system pipelining.

Bug: 5963420
Change-Id: Iab33594bc5df8aa05232ef64c64e98fc61c5bf52
2012-02-07 18:38:11 -08:00
Dianne Hackborn
cbb722ed06 Don't wait for current activity to pause before resuming next.
We can do this now that we ensure processes are not killed until
they have been stopped.  If the two activities are in the same
process, the ordering will still be correct because we schedule
the pause before the resume.

Change-Id: I209ba739b41e832d35db3edd34d1e7af354cc183
2012-02-07 18:33:49 -08:00
Robert Greenwalt
ec159352fe Merge "Make NDC not block forever and handle restart." 2012-02-07 16:19:56 -08:00
Robert Greenwalt
813af8d464 Make NDC not block forever and handle restart.
Need changes in core.

Still possible for netd to get wedged but system won't die because of it.
Leads the way to having forking netd - then only individual commands would
wedge, promoting stability.

bug:5864209
Change-Id: Ifcd37511c8239fe3df7e9070869b63a9c5649bd2
2012-02-07 15:59:49 -08:00
Jeff Sharkey
b5718c29ae Merge "Send broadcast when changing restrict background." 2012-02-07 15:50:02 -08:00
Dianne Hackborn
dc210ade0a Merge "Return information about whether overlays are disabled." 2012-02-07 13:46:46 -08:00
Jeff Sharkey
1f8ea2dcd1 Send broadcast when changing restrict background.
When changing global restrict background status, send connectivity
change broadcast, since it radically changes DISCONNECTED/BLOCKED
status system-wide.

Also reduce verbose stats logging.

Bug: 5854466
Change-Id: I3b612c520f50cc3000a3a569b7e0ab5f691cc2bd
2012-02-07 12:08:58 -08:00
Jeff Sharkey
e7171effdf Merge "List rotated netstats files during --checkin dump." 2012-02-07 10:45:41 -08:00
Dianne Hackborn
5989e8e7a6 Return information about whether overlays are disabled.
Change-Id: I85ae42e9f28461f5142cc6b3c8e25ff3f195805a
2012-02-06 21:21:05 -08:00
Jeff Sharkey
706498d387 List rotated netstats files during --checkin dump.
Also disable verbose logging.

Change-Id: I4c51e05d695eac43f0d9c28f9699f1655c642a99
2012-02-06 17:35:11 -08:00
Craig Mautner
a52b6e7bcf Merge "Extract code from performLayoutAndPlaceSurfacesInnerLocked() into multiple methods." 2012-02-06 17:04:23 -08:00
Craig Mautner
61ac6bb250 Extract code from performLayoutAndPlaceSurfacesInnerLocked() into multiple methods.
Change-Id: I80152c38741ce73b92da9483cfed84efbac34f89
2012-02-06 16:52:16 -08:00
Amith Yamasani
13c7b82234 Merge "Check for null ActivityInfo." 2012-02-06 15:39:40 -08:00
Amith Yamasani
2f6c9eb9c2 Check for null ActivityInfo.
Bug: 5970556
Change-Id: I87ebad1918311f24333d16cb6732742a1dd96685
2012-02-06 15:31:35 -08:00
Mathias Agopian
587ae01ad6 fix a crasher when starting SF with the screen off
SF could end-up in an infinite crash-loop during startup if it
was stopped while the screen was off. This happened because
the thread that manages screen blanking was started before
other important pieces of SF were initialized.

Change-Id: I0dded11dbf2395fdd57b673859a7aa0fa9eb32b6
2012-02-05 02:15:28 -08:00
Mathias Agopian
cf7f0c7328 ui freeze workaround: reenable triple buffering mode
we're seeing UI freezes when window updates and
composition are separated. for now we workaround this
by always doing a composition after window updates on
vsync. triple buffering is reenabled for performance.

Change-Id: I693d705000b7452489bb0b4918fbeadb9879315c
2012-02-05 01:49:16 -08:00
Mathias Agopian
077f29f8ae improve SF dumpsys 2012-02-05 00:19:27 -08:00
Mathias Agopian
fe005282db fix UI freezes
In some situations SF would mark a window as "has a pending update"
but would never process that update because the window is not
visible (fully transparent, hidden by another window, etc...), this
window would then be "stuck" until some other window updated.

Change-Id: Ifa18a9aef3a53f2593b473556702688ae62d9503
2012-02-04 15:44:04 -08:00
Mathias Agopian
af87216387 attempt to fix an ANR in various apps
recent changes in SF introduced a hang where some windows would
stop being refreshed.
This is an attemp to fix that.

Change-Id: I6aa32ac0d6f1c0a6aea8f6195825dc4f4e6f93f9
2012-02-03 17:22:09 -08:00
Glenn Kasten
d9d68dcb62 Don't double destruct audio_track_cblk_t
Fortunately audio_track_cblk_t doesn't have a destructor, but for clarity
remove the double destruction.

Also add warning not to add any virtuals to audio_track_cblk_t.

Change-Id: I70ebe1a70460c7002145b2cdf10f9f137396e6f3
2012-02-03 16:16:46 -08:00
Glenn Kasten
d153b1fc3a Use pid_t not int
Change-Id: Iad1c2fd4152e94080ad8c65c13ddf4519fc2ed27
2012-02-03 16:14:15 -08:00
Glenn Kasten
4fc616192a Remove dead code
mFormat is unused in resampler
mClientTid is unused
local variable pid is unused in dump

Change-Id: Ib156e38029366620bfeff2a13e73471867155a5b
2012-02-03 16:09:30 -08:00
Glenn Kasten
3f6d83a68a Declare more IAudioFlinger methods const
This is just documentation, as C++ method const-ness doesn't mean anything
for a binder API.  Instead, here const means "no side effects".

Change-Id: Iaa9cd2fe477db10ae9a40cac4f79f0faa9b4e5e6
2012-02-03 15:40:56 -08:00
Glenn Kasten
450b9985b8 Use bool instead of int
The .h is not modified to avoid increasing data size.

Change-Id: Ide4a821a5b16424ffa03471dfff98dc3e9b5f751
2012-02-03 15:36:47 -08:00
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