title: How to grant android.permission.RECORD_AUDIO permissions to android shell user?
body: <p>I build some command line tool with android NDK and execute it in /data/local/tmp. Now it prompts me “requires android.permission.RECORD_AUDIO”. It's usually in AndroidManifest.xml for java application, but how to grant it to android shell user? </p>
  
  <p>Source code like:</p>
  
  <pre><code>sp&lt;AudioRecord&gt; rec = new AudioRecord(AUDIO_SOURCE_MIC, 44100, AUDIO_FORMAT_PCM_16_BIT, AUDIO_CHANNEL_IN_MONO);
  </code></pre>
  
  <p>Logcat:</p>
  
  <pre><code>I/AudioFlinger( 3772): AudioFlinger's thread 0xf0e838c0 ready to run
  W/ServiceManager( 3772): Permission failure:android.permission.RECORD_AUDIO from uid=2000 pid=-1
  E/        ( 3772): Request requires android.permission.RECORD_AUDIO
  E/AudioFlinger( 3772): openRecord() permission denied: recording not allowed
  E/AudioRecord(14132): AudioFlinger could not create record track, status: -1
  --------- beginning of crash
  ...
  </code></pre>