I build some command line tool with ndk and execute it in /data/local/tmp. Now it prompts me "requires android.permission.RECORD_AUDIO" when I call some OpenSLES API in my command line tool:
W/AudioRecord( 4226): AUDIO_INPUT_FLAG_FAST denied by client
W/ServiceManager( 207): Permission failure: android.permission.RECORD_AUDIO from uid=2000 pid=4226
E/ ( 207): Request requires android.permission.RECORD_AUDIO
D/PowerManagerService( 964): handleSandman: canDream=false, mWakefulness=Asleep
E/AudioFlinger( 207): openRecord() permission denied: recording not allowed
E/AudioRecord( 4226): AudioFlinger could not create record track, status: -1
E/libOpenSLES( 4226): android_audioRecorder_realize(0x453430) error creating AudioRecord object
W/libOpenSLES( 4226): Leaving Object::Realize (SL_RESULT_CONTENT_UNSUPPORTED)
I have also tried to grant shell with pm grant:
pm grant "com.android.shell" android.permission.RECORD_AUDIO
pm grant "com.android.shell" android.permission.RECORD_AUDIO
pm grant "com.android.shell" android.permission.RECORD_AUDIO
Operation not allowed: java.lang.SecurityException: Package com.android.shell has not requested permission android.permission.RECORD_AUDIO
changing /system/etc/permissions/platform.xml has no effect too.
Can I just debug my OpenSLES demo in the android shell ? How can I get more permisson just in shell .
Must I create a jni and java project for every experimental code snippet and modify them together when I change some C++ interfaces ?
Can I access RECORD_AUDIO, CAMERA directly in a command tool from shell ?