7880 Commits

Author SHA1 Message Date
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
Glenn Kasten
8df33080f9 Remove dead setVolume() and mVolume[2]
Change-Id: I94b835434093e920432614eb5007101e87758f32
2012-01-17 13:33:33 -08:00
Glenn Kasten
fb6b5bdcea Merge "Use audio_mode_t consistently" 2012-01-17 11:32:53 -08:00
Glenn Kasten
6e987a46f4 Check stream type in AudioFlinger::createTrack
A bad parameter to AudioFlinger::createTrack could cause mediaserver to crash.

Other AudioFlinger stream type cleanup:
 - Simplify range check for audio_stream_type_t
 - Add comment about mStreamTypes array initialization.

Change-Id: Ia33aa1cce0fdd694b08d9288816ffc097a9543d0
2012-01-17 07:45:07 -08:00
Glenn Kasten
c80f407829 Merge "Fix locking for mMasterVolume and mMute" 2012-01-17 07:28:14 -08:00
Glenn Kasten
8c17a2f088 Merge "Use size_t for frame size" 2012-01-17 07:27:46 -08:00
Glenn Kasten
3c6b9cca79 Merge "Use audio_stream_type_t consistently" 2012-01-17 07:25:36 -08:00
Glenn Kasten
dd3ca2e268 Merge "AudioTrack and AudioFlinger send level cleanup" 2012-01-17 07:18:26 -08:00
Glenn Kasten
e6f8a425da Fix locking for mMasterVolume and mMute
mMasterVolume and mMute are both protected by mutex in AudioFlinger class, but
there were two places where they were accessed without a mutex.

Also make AudioFlinger::mMasterMute private not protected.

Change-Id: Ia3897daeb5c50313df5bcc071824357526237f3e
2012-01-13 15:53:10 -08:00
Glenn Kasten
4790bd8be8 AudioTrack and AudioFlinger send level cleanup
Add an API to control block for getting/setting send level.
This allow us to make the mSendLevel field private.

Document the lack of barriers.

Use 0.0f to initialize floating-point values (for doc only).

Change-Id: I59f83b00adeb89eeee227e7648625d9a835be7a4
2012-01-13 15:25:14 -08:00
Jeff Brown
dfef19940f Merge "Fix a few memory leaks in the input dispatcher." 2012-01-13 15:16:29 -08:00
Glenn Kasten
faf354dc7f Use size_t for frame size
except in the control block, where we don't have room.

In AudioFlinger::ThreadBase::TrackBase::getBuffer,
read the frame size from control block only once.

Change-Id: Id6c4bccd4ed3e07d91df6bbea43bae45524f9f4e
2012-01-13 14:58:44 -08:00
Glenn Kasten
1e80869133 Get AID_GRAPHICS from right place
Change-Id: I97b1754dc7260fec083275c71a8f71ebfb2cefa8
2012-01-13 13:45:39 -08:00
Dianne Hackborn
f88d1493aa am 10065177: am 2e282f35: Merge "Fix issue #5823276: home repaints after full-screen app is exited" into ics-mr1
* commit '100651779fde99f7ae2a10719d688b51115f08e9':
  Fix issue #5823276: home repaints after full-screen app is exited
2012-01-13 13:01:48 -08:00
Dianne Hackborn
2e282f35b0 Merge "Fix issue #5823276: home repaints after full-screen app is exited" into ics-mr1 2012-01-13 12:56:40 -08:00
Christopher Tate
ecce05fac6 am 89620c5d: am 2cf18d28: Merge "Streamline package-installed handling by the Backup Manager" into ics-mr1
* commit '89620c5d982858f590f3740169c9f69ee380be3e':
  Streamline package-installed handling by the Backup Manager
2012-01-13 12:18:55 -08:00
Christopher Tate
2cf18d2878 Merge "Streamline package-installed handling by the Backup Manager" into ics-mr1 2012-01-13 11:49:20 -08:00
Glenn Kasten
bc1d77b6cb Use audio_stream_type_t consistently
At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t.  Java is still int.  Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.

Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
2012-01-13 10:20:14 -08:00
Guang Zhu
6a78cd8586 Merge "Move where prop dev.bootcomplete is set" 2012-01-12 21:00:15 -08:00
Mathias Agopian
a8f75fe9a9 Merge "fix a bug with vsync management" 2012-01-12 18:49:07 -08:00
Jeff Brown
c0cb3dc2c1 Fix a few memory leaks in the input dispatcher.
Bug: 5862398
Change-Id: Iae3284a223b8307f541a7987f90f5b28e70b9244
2012-01-12 18:30:12 -08:00
Guang Zhu
191713a51f Move where prop dev.bootcomplete is set
Currently test harnesses depends on this flag to determine when
the system is fully booted, and start dismissing keyguard, launch
tests etc. However, the flag is usually set when the boot animation
is still running, and typically about 5 seconds before keyguard is
up etc. Moving to to when BOOT_COMPLETE broadcast is sent makes it
work more reliable.

We also discussed about using sys.boot_completed instead,
unfortunately this flag is not in all platform and we still have
backwards compatibility to maintain in order to drive unbundled
tests.

Change-Id: I99b084cd70d8e4bcfe490ddeca868136d32712e2
2012-01-12 17:39:40 -08:00
Christopher Tate
0bacfd2ba6 Streamline package-installed handling by the Backup Manager
In particular, don't do O(asec_apps * installed_apps) work during the
broadcast receiver's operation.  On devices with many installed apps
and a large number of them moved to ASECs, this was causing the system
process to become unresponsive and the watchdog to fire -- which in turn
would initiate a restart loop, as the same package-installed broadcast
would then be issued again once the package manager rescanned the ASEC
containers, ad infinitum.  With this change, the expensive call to the
package manager is only made once rather than asec_apps times.

Bug 5850283

Change-Id: I14e280ea1fa6af19cebc58869a20fbb599c92c8c
2012-01-12 16:15:09 -08:00
Mathias Agopian
87c6ea6eed fix a bug with vsync management
this bug was introduced recently. we were signaling *all* clients
regardless of the vsync rate.

Change-Id: I2ae8a6c820a390f602382596ba75e8ed737fb2ef
2012-01-12 16:13:54 -08:00
Chia-chi Yeh
5d134343ca am 1e9e7f76: am ff321d49: Merge "VPN: silence VPN notifications." into ics-mr1
* commit '1e9e7f76d5e6187befaf96eece258c27fd08bdc5':
  VPN: silence VPN notifications.
2012-01-12 14:30:44 -08:00
Chia-chi Yeh
ff321d496a Merge "VPN: silence VPN notifications." into ics-mr1 2012-01-12 14:24:30 -08:00
Dianne Hackborn
01b02a734d Fix issue #5823276: home repaints after full-screen app is exited
Don't consider a window as a candidate for the top fullscreen window
if it is not going to be a candiate for layout.

Also don't consider windows a candidate for layout if their app token
is hidden.  This fixes a transient state where we are preparing to
unhide the window but have not done so yet.

Change-Id: Ife5299ffa003c1df1a4f787b7a2809cbf614ec16
2012-01-12 14:05:03 -08:00
Mathias Agopian
2fdc357bc6 Merge "remove dead/usnused code" 2012-01-12 10:37:10 -08:00
Mathias Agopian
3adbec281e Merge "Fix an issue with VSYNC" 2012-01-12 10:36:39 -08:00
Glenn Kasten
accb114e59 Use audio_mode_t consistently
It was int or uint32_t.
Also make getMode() const.

Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
2012-01-12 09:52:37 -08:00
Robert Greenwalt
cc9858049d am 1800ccfa: am 4b1261f1: Merge "Disable wimax when mobile data is in Settings" into ics-mr1
* commit '1800ccfa647cca6e9c051759312d6af12f134f5a':
  Disable wimax when mobile data is in Settings
2012-01-12 09:29:30 -08:00
Robert Greenwalt
4b1261f17a Merge "Disable wimax when mobile data is in Settings" into ics-mr1 2012-01-12 09:24:45 -08:00
Mathias Agopian
0db7590ed2 remove dead/usnused code
Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
2012-01-11 22:03:41 -08:00
Mathias Agopian
7e9a3706d9 Fix an issue with VSYNC
one-shot VSYNC listeners could miss a VSYNC event if
scheduled while in waitForVsync().

Change-Id: I720485784aecfea6cc7a23c77081d7af3c9c71db
2012-01-11 22:03:40 -08:00
Chia-chi Yeh
50fe709995 VPN: silence VPN notifications.
Bug: 5852859
Change-Id: I269d8de298a1fd69a8d777150ae97927537a5424
2012-01-11 14:26:24 -08:00
Glenn Kasten
1eac460122 Merge "Simplify range check for audio_mode_t" 2012-01-11 11:38:21 -08:00
Glenn Kasten
88ef0a73fc Merge "Use correct type for hardware call state" 2012-01-11 10:25:23 -08:00
Glenn Kasten
ca61ea8499 Merge "Use consistent style of & reference for AutoMutex" 2012-01-11 10:23:04 -08:00
Glenn Kasten
482b9c2d34 Merge "AudioFlinger new can't fail" 2012-01-11 10:22:19 -08:00
Glenn Kasten
bb8d6fb4fc Merge "Fix build warning" 2012-01-11 10:01:34 -08:00
satok
c36905673a Enable subtypes when the implicitly enabled subtype is not ascii capable keyboard
Bug: 5806103

Change-Id: I1a83b227498073c47567f73566043c273809adc9
2012-01-11 17:03:03 +09:00
Jeff Sharkey
2cc28deb9e Merge "Move non-monotonic reporting to interface." 2012-01-10 17:41:01 -08:00
Jeff Sharkey
5a7bcf31a4 Move non-monotonic reporting to interface.
Report non-monotonic NetworkStats through an observer interface
instead of throwing, since those events are still recoverable.

Change-Id: Ic0749f4634b0ac05dbe90e95ca490957ec8b2f23
2012-01-10 17:24:44 -08:00
Glenn Kasten
01aaf2c401 Simplify range check for audio_mode_t
AudioSystem::setMode previously allowed negative modes, but these were
then rejected by AudioFlinger.

Now negative modes (including AUDIO_MODE_INVALID and AUDIO_MODE_CURRENT)
are explicitly disallowed.

Change-Id: I0bac8fea737c8eb1f5b6afbb893e48739f88d745
2012-01-10 15:42:32 -08:00
Danielle Millett
de7a2f3054 DO NOT MERGE - Cherry picking from master to MR1
Fix 5783857: Device Policy Manager doesn't allow Face Unlock

This makes it so that if face unlock is enabled and then a device policy
manager that requires something more secure than face unlock is installed,
the user will be forced to choose a new acceptable lock type.

This was previously fixed for the case where the device had been reset, or
the shell was restarted after setting face unlock, but not for the case where the
device remained on between setting face unlock and setting up a device policy
manager.

Also changed the function ordering of saveLockPattern() so that the overloaded
wrapper function is next to the main function.

Change-Id: Ibed8c4ab137ebbc07fb143faef6f047bc6dc4474
2012-01-10 11:40:41 -05:00
Steve Block
ec193dec4d Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE
See https://android-git.corp.google.com/g/157519

Bug: 5449033
Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-09 21:36:22 +00:00
Glenn Kasten
4e7191448d Merge "By convention const goes before the type specifier" 2012-01-09 11:59:17 -08:00