Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)

For older audio blobs where is_source_active and is_stream_active_remotely
doesn't exist, receiving a notification and dumpsys crashes the audio service.

Change-Id: I554f00ba7f171d2ea91627cae2281623383b3ca7
Merge "Added ifndef ICS_AUDIO_BLOB around non-existent functions (3/3)" into cm-10.2
Add camera parameters for htc evo 3D. (1/2)

Use BOARD_HTC_3D_SUPPORT to enable.

Change-Id: I28fa3f1586071bcc78b8e887bbbf699d338a0ceb
audioflinger: Fix delay in enabling effect for LPA

 - Enable/disable of effects for LPA is taking time
 - Enable notification is not sent to effects thread till
   configure is called on each effect with isForLPA flag
   set to true, this happens only when applyEffcts is
   called in write of directoutput thread, so till that time
   effects are not applied and there is a delay in effects
   getting applied.
 - Insted of checking effcts LPA flag check the effectchain's
   LPA flag while sending notification to effects thread

Change-Id: I8d7559a60e5c6769d72022517daa05c84df54885
CRs-Fixed: 525510
audioflinger: Fix pops in LPA while effects are applied

 -Issue: LPA playback while effect are applied, has pops/noise
  as below scenarios
  1) LPA Playback + taking snapshot with camera
  2) LPA Playback + changing media volume from settings app
  3) LPA plaback after non-LPA playback
 -Rootcause:Effects meant for LPA are getting applied in
  normal playback path
 -Fix: In threadloop of mixerthread if current effect
  chain is equal to LPAeffectchain, don't apply effects.

CRs-Fixed: 526799

Change-Id: Ic255ef2db81545abd119633e8fc6a7bae5d2f38c
fix a race condition of MediaPlayerServce::Client::mClient

there will be race condition between mClient.clear in MediaPlayerServce::Client::disconnect method
and c=client->mClient in in MediaPlayerServce::Client::notify method

Change-Id: I767294c4cb864c08e9c0e9f23d6d304a39016205
Signed-off-by: beanz <beanz@marvell.com>
Fixed the wrong timestamps issue about camera recording

On emulator, the camera video recording crashes randomly.
It's caused by wrong timestamp when encoding the video frame.
The element of the vector is erased before accessing it.
Therefore, when reading the timestamp from the element,
the memory of the element has been changed.

Change-Id: I9750417fbb9dc4697ccae1e78e286b23925d3764

Signed-off-by: Panfeng Chang <panfengx.chang@intel.com>
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Fix overflow of rand in ARTPConnection

without this fix, (rand()*1000)/RAND_MAX is mainly 0.

Change-Id: I48ae940a7b6974b197d81732774c9dcea107bcf1
Signed-off-by: Yajun Zeng <beanz@marvell.com>
Replace obsolete CLOCK_MONOTONIC_HR by CLOCK_MONOTONIC

(cherry-pick of da1a325bc0a1421f4233e62704da4fab8b0acf7b.)

Bug: 8895727
Change-Id: I29d5dcf8519600fdd2910345449c66a5c1284646
Fix typo.

Change-Id: Ia72ed2bef54751dc2d6c3379a58de95a0e9ebfdd
Prevent AudioCommands being freed before read

When AudioCommandThread::threadLoop process AudioCommands it was
possible for it to delete a command where the posting thread still
hadn't read that status from it.

If a second command signaled the thread loop to continue after it
had inserted a new command while the thread loop was actually waiting
for the first command to report that it had read the status the
thread loop would continue and delete the first command.

Changed the wait condition when waiting for the calling thread to
read status to use command->mCond instead of mWaitWorkCV. This way
it's guaranteed that the signal to continue comes from the correct
thread.

Change-Id: Ia69b48cb4fdfaf8b4c83b56a197fb9f2058a92d1
Fix compilation warning: incorrect format specifier for type 'ssize_t'.

warning: format '%ld' expects argument of type 'long int',
but argument 7 has type 'ssize_t {aka int}' [-Wformat]

Change-Id: I823835a26320a3abb82f8dff9fbe82e5132e7556
Signed-off-by: Scott Fan <fancp2007@gmail.com>
Set u.ext_data to null after it has been freed

SEGV_MAPPER crash could happen in MetaData::typed_data::freeStorage.
The faulty address could be both random pointers and deadbaad. It
seems like free could be called more than once on u.ext_data. Set
u.ext_data to null after it has been freed as there already is a
null check before trying to free it.

Change-Id: I710c49f9c231bd8852159914c0b2add58a685f0e
disable camera sounds (3/3)

Change-Id: I3540e652cdc5601dd5ea83a314b96f98d0cd9917
frameworks/media: Fix aliasing violations

Change-Id: I0c3ad4d935abe6cf6df222f7d70381d868f15fe8
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
downmix: Fix aliasing violation

Change-Id: I1907da54e9ec40c9afe56c488a974d5286b787e4
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
EffectVisualizer: Fix aliasing violations

Change-Id: I35532464df41a64ed920c34ad4bc1054cf6324b2
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
av: Fix compile errors

Don't use memcpy() on areas that may overlap
Fix aliasing violation

Change-Id: Icd54cf12c2485a3d2789d1fb75c3a8a964c4163f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Update EffectDownmix.c

Restore memcpy() instead of memmove()
frameworks/media: Fix aliasing violations

Change-Id: Ic65b65c2e3cf05fc53378b374cfba703def51e0c