appop: reimplement OP_RECORD_AUDIO op check in mediaserver

Obtain the real package name for the calling app from the packagemanager binder and
link to client registry. Also block only openRecord and createEffect (which are the
methods used to record audio), and ignore the createTrack that is used also by
legacy audio apps and isn't related to audio recording.

Change-Id: Iedd6022fab1efab47a29da7bd07e922dcdeb294c
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Revert "appop: reimplement OP_RECORD_AUDIO op check in mediaserver"

 * This breaks various applications which use the effects API, like
   visualizers.

This reverts commit eb48405109a6a2d2a1d9cb2aaac36e5c71bb5f5b.

Change-Id: I7993aaff67a0aa5f815cc42d3670f3397d7582ac
Revert "libstagefright: Keep LOOPING/AUTO_LOOPING flag during teardown"

This reverts commit 9a59488dae2c70ab0c55cda7721824ca1a71340d.

Change-Id: I9af6fe9f2086cfe17f55b214d5093d7acece791c
stagefright: Set bit_width if ENABLE_AV_ENHANCEMENTS is defined

the compiler failed with error "has no member named bit_width" because bit_width is set only ifdef ENABLE_AV_ENHANCEMENTS

https://github.com/CyanogenMod/android_frameworks_av/blob/cm-11.0/media/libstagefright/AudioPlayer.cpp#L228

Change-Id: I931879f09164482fc09e53a4135d88537b05c7ff
libstagefright: refactor Legacy LPA makefile

  - add in msm7x27a
  - remove unused USE_LPA_MODE flag

Change-Id: I9e8d9376e1cfbd37e6457c0fd8e6252848f6b24d
libstagefright: Enable meta mode for 7x27a video encoder

msm7627a family of chipsets supports only one input frame at
one time. camera expects the input frame to be released before
sending another frame. so send one input buffer and available
output bufefrs to video encoder component. Release the input
buffer to camera (to get another frame) after receiving input
frame done callback from video encoder component.

Change-Id: I8fbc911f046ff7e2a3047dd65d8c09ac2d8608e2
libstagefright: Add support for custom LPA buffer size in legacy LPAPlayer

     - on msm7x27a with bootloader heap for lpa audio during audio playback with,
       DSP Manager effects enabled there is a lot of stuttering with the default buffer size.
       with bl heap we need buffer size of 480, but that breaks audio at in cm. So we have,
       to use buffer size of 512 to get audio working but it makes stuttering as mentioned.
       so add support for a custom buffer size so we can use 480 buffer size.

Change-Id: Ib4b5222b4b64d42288e0ad5c95910e385d172374
Revert "audio:Avoid AudioTrackThread if Track creation fails"

This reverts commit b96f07930159ebbdcd44645ac62604ff6cbddfc7.

Change-Id: Iae20ed1c59a206450b3de18118b1b9c4a8a469c5