Fix preventing from heap overwrite in capture command

There was heap usage error in case of stop of audio framework while
capturePoint was negative. Pointer to reply data was moved but
final silence write was done using original buffer size.
Now silence set is done at the beginning under the condition
that framework has stopped.

Change-Id: I7dab1e922f1813e5fbfd4a64c8b0d15d9465520c
media: Add Ops check before starting audio recording.

Confirm user permission before starting audio recording.

Change-Id: Ia4e6d8fb6986d4e73fb656ba0efaf42c210e92af
fix deadlock issues that arise when there are simultaneous
effect control interface calls to proxy and to
non sub-effect wrappers(eg., bundlewrapper) from audioflinger
Also, return NO_ERROR when CMD_OFFLOAD succeeds

Whenever there are parallel calls to proxy and non sub-effects wrappers,
some of the calls are not completed. This is due to deadlock arsing out
of Proxy waiting for the subeffect call to return and subeffect waiting
for proxy to release lock.
The call flow is changed to a cleaner and simple one - Proxy gets the
aeli(effect library info) of subeffects during the EffectGetSubEffects()
call. Therby, proxy will manage the sub effects by itself rather than
going through effects factory.

Signed-off-by: jpadmana <jayashree.r.padmanaban@intel.com>
Bug: 12424044
Change-Id: I16852222f1d0e94e433a19177729323a4bb1c090
Merge branch 'kk4.4' of https://github.com/SlimRoms/frameworks_av into kk4.4