appop: protect mediaserver with OP_RECORD_AUDIO op check.

Some apps could use a binder to direct link to the mediaserver, bypassing
the android media framework security. Add an internal check to createTrack and openRecord
mediaserver's methods to protect them from undesired access.

Thanks to Blackphone for discovery and contribute this patch.

Change-Id: I12601d19ee093cf4c76ebf3a96aa63f6562dafac
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
stagefright: Handle offload fallback for 24-bit tracks

 * We need to carefully handle fallback in the 24-bit lossless
   sources for outputs such as A2DP, which cannot use PCM
   offload.
 * Clean up the code while in here as well.

Change-Id: I398d964a3c5b18f58fcc79376bc29222e796badc

Conflicts:
	media/libstagefright/ExtendedUtils.cpp
	media/libstagefright/include/ExtendedUtils.h