Fix permission check for audio recording

Define input types covering the different usecases for audio
  recording, and check the corresponding permissions when
  starting to record.
Move the permission check from audio flinger to audio policy,
  as only the policy has the information to determine which
  permission to enforce.
Fix missing permission when an application records audio
  and the audio is injected by an external policy.

Bug 18736417

Change-Id: If7ec040502242c990ac8ea464db484339bdce573
6 files changed