2331 Commits

Author SHA1 Message Date
Glenn Kasten
1b33107f37 Merge "Don't double destruct audio_track_cblk_t" 2012-02-08 08:40:15 -08:00
Glenn Kasten
1e3a8d3090 Merge "Remove dead mutex in AudioTrack/AudioRecord thread" 2012-02-08 08:34:33 -08:00
Glenn Kasten
09b9ba0db2 Merge "AudioTrack declare more methods const" 2012-02-08 07:42:40 -08:00
Glenn Kasten
16d64ad699 Merge "Declare more IAudioFlinger methods const" 2012-02-08 07:39:27 -08:00
Romain Guy
68c02e25e8 Merge "Preliminary support for clipRect(Rect, Op)" 2012-02-07 17:07:00 -08:00
Romain Guy
967e2bf3ac Preliminary support for clipRect(Rect, Op)
This adds basic support for clip regions. It is currently disabled at compile
time. Enabling clip regions will require setting up a stencil buffer.

Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
2012-02-07 17:04:34 -08:00
James Dong
f5a9f439b6 Don't call virtual function in destructor of SurfaceMediaSource
Change-Id: I3cbc2b1222335b61c814b5cdcfaefa495148b0ec
2012-02-06 12:17:44 -08:00
James Dong
cea2c396c5 Merge "Don't call virtual functions in the destructor for audio and camera source classes" 2012-02-04 05:54:54 -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
7c2e37dd32 AudioTrack declare more methods const
Change-Id: I4999e984460893961d0d8092cff17f3cf07d7214
2012-02-03 15:48:25 -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
James Dong
4651c0ea80 Merge "Don't call virtual functions in destructors for the writer classes" 2012-02-03 15:37:40 -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
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
08d5eb9885 Merge "Make AudioTrack control block volume field private" 2012-02-03 07:18:06 -08:00
James Dong
946ab0ff30 Don't call virtual functions in the destructor for audio and camera source classes
Change-Id: Ia74ffc1c0cbd7971697f5e3c476e340ec5c7727a
2012-02-02 18:11:53 -08:00
Mathias Agopian
b545eaa9cb Merge "separate transactions from updates" 2012-02-02 16:28:05 -08:00
James Dong
c2240b127b Don't call virtual functions in destructors for the writer classes
Have not found any concrete bugs related to these calls yet, but we should avoid
calling virtual functions in destructors, regardless.

Change-Id: I2d47b79d3fb2d29f418619bee83aa147d232a5d4
2012-02-02 15:13:56 -08:00
Glenn Kasten
91a7b145df Merge "More audio_stream_type_t" 2012-02-02 13:26:12 -08:00
Glenn Kasten
ac1748ce33 Merge "Thread::getTid returns pid_t gettid() after run" 2012-02-02 13:24:52 -08:00
Glenn Kasten
4b80abcdd5 Remove dead mutex in AudioTrack/AudioRecord thread
The client callback threads had mutexes called AudioTrackThread::mLock
and ClientRecordThread::mLock.  These mutexes were only used by start()
and stop(), and were unused by the thread itself.  But start() and
stop() already have their own protection provided by AudioTrack::mLock
and AudioRecord::mLock.  So the thread mutexes can be removed.

Change-Id: I098406d381645d77fba06a15511e179a327848ef
2012-02-02 11:23:30 -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
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
Dianne Hackborn
6c997a9e88 aapt now sorts the strings in the resource string pool.
In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).

Also add a new aapt command to print the contents of the resource
table string pool.

Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
2012-01-31 15:41:30 -08:00
Andreas Huber
f6b4ca408e Slighly improve the API to discover if the OMX stack is running in the local
process.

Change-Id: Idd3c2f0d4a9542af01a3fdfd3b0bfab90e083505
2012-01-31 11:16:24 -08:00
Glenn Kasten
b7cffb4140 More audio_stream_type_t
Change-Id: I1260259efe0aa3fc1ef13de69758aaa592e1f815
2012-01-27 16:33:43 -08:00
Glenn Kasten
23f7ad39ef Use ToneGenerator::tone_type consistently
Also remove defaults in startToneCommand(), they're not needed and the
default for tone type was nonsense.

Change-Id: I70fa8cee4f3dbb8c66ceb3719c8d3d2f447f05b9
2012-01-27 16:01:44 -08:00
Glenn Kasten
882c0a20c5 Use audio_in_acoustics_t consistently
Change-Id: I0a9dd668fb2e57b1c3ece3190588194974b99062
2012-01-27 13:31:54 -08:00
Glenn Kasten
c14639a9a1 Merge "Use audio_source_t consistently" 2012-01-27 09:06:00 -08:00
Glenn Kasten
0f0fbd9441 Use audio_source_t consistently
Was a mix of audio_source_t, uint8_t, and int.

Related fixes:
 - fix comments in MediaRecorder.java
 - AudioPolicyService server side was not checking source parameter at
   all, so if the client wrapper was bypassed, invalid values could be
   passed into audio HAL
 - JNI android_media_AudioRecord_setup was checking source for positive
   values, but not negative values. This test is redundant, since already
   checked at Java and now checked by AudioPolicyService also, but might
   as well make it correct.

Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
2012-01-26 16:50:19 -08:00
Andreas Huber
afe02df45e The software AAC encoder is now an OMX component.
Yay.

Change-Id: I74938a20b4e0a622836ea5184d3761180eb0f5de
2012-01-26 15:45:38 -08:00
Dianne Hackborn
d96e3dfa02 Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc.
Change-Id: I519d6cdc527a402d93b98df17a64fc1da52ad598
2012-01-25 15:14:50 -08:00
Glenn Kasten
34f9f8bb83 Remove AudioFlinger dependencies on client
Change-Id: Ibb591e41a3ca5d7015e2b66b98b8fef5f415fb37
2012-01-20 17:12:59 -08:00
Glenn Kasten
bc4de888c1 Make AudioTrack control block volume field private
This is part of the process of abstracting the control block
to make it easier to maintain.

Change-Id: Idb8f461e68dab3bcf268159cc0781651c6fb7094
2012-01-20 16:19:59 -08:00
Glenn Kasten
0a204ed0f5 Use audio_format_t consistently, continued
Was int or uint32_t.

When AudioFlinger::format can't determine the correct format,
return INVALID rather than DEFAULT.

Init mFormat to INVALID rather than DEFAULT in the constructor.
Subclass constructors will set mFormat to the correct value.

Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
2012-01-20 14:41:34 -08:00
Glenn Kasten
15f51ccee1 Merge "Remove dead file include/media/thread_init.h" 2012-01-20 12:15:38 -08:00
Glenn Kasten
7524a59252 Merge "Remove dead setRingerMode(mode, mask)" 2012-01-20 10:07:06 -08:00
Glenn Kasten
96f46033b4 Remove dead file include/media/thread_init.h
Change-Id: I98688bb7109b5f82953988935c7c33fe3c7f4ec0
2012-01-19 10:13:52 -08:00
Glenn Kasten
92ecdd6303 Merge "Fix incorrect includes of AudioTrack.h" 2012-01-19 06:10:37 -08:00
Glenn Kasten
a6dafea172 Fix incorrect includes of AudioTrack.h
Remove unnecessary includes of AudioTrack.h.
Use forward declaration of class names in preference to #include when possible.

Change-Id: I12982811fa75c2c7695d8bbfa595a7aaec047dc0
2012-01-18 16:06:47 -08:00
Glenn Kasten
ee7fea9f2f Remove dead setRingerMode(mode, mask)
Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
2012-01-18 15:10:31 -08:00
Andreas Huber
28ea013f25 Temporarily restore AudioSystem/AudioTrack APIs with their former signatures
until we get updated prebuilts from vendor.

Change-Id: I8aae81d2513edca0ab268053a11c8c4206879e61
2012-01-18 10:51:55 -08:00
Glenn Kasten
540c35f7aa Merge "Track volume cleanup" 2012-01-18 07:46:18 -08:00
Eric Laurent
1be4afecb7 Merge "audio framework: manage stream volume per device" 2012-01-17 17:35:03 -08:00
Glenn Kasten
0632bad8ba Track volume cleanup
Always read and write track volumes atomically. In most places this was
already being done, but there were a couple places where the left and
right channels were read independently.

Changed constant MAX_GAIN_INT to be a uint32_t instead of a float.
It is always used as a uint32_t in comparisons and assignments.
Use MAX_GAIN_INT in more places.

Now that volume is always accessed atomically, removed the union
and alias for uint16_t volume[2], and kept only volumeLR.

Removed volatile as it's meaningless.

In AudioFlinger, clamp the track volumes read from shared memory
before applying master and stream volume.

Change-Id: If65e2b27e5bc3db5bf75540479843041b58433f0
2012-01-17 16:25:17 -08:00
Eric Laurent
9bc8358dda audio framework: manage stream volume per device
Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.

The main changes are:
- AudioService now keeps tracks of stream volumes per device:
 volume indexes are kept in a HashMap < device , index>.
 active device is queried from policy manager when a volume change request
 is received
 initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.

Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
2012-01-17 15:15:04 -08:00