am c1c82509: Merge change 2163 into donut
Merge commit 'c1c82509fb78403a969040cf057a66cbe3bfa538' * commit 'c1c82509fb78403a969040cf057a66cbe3bfa538': Fix permission hole for RECORD_AUDIO created when we moved the MediaRecorder
This commit is contained in:
committed by
The Android Open Source Project
commit
183baba8d1
@@ -37,6 +37,7 @@
|
||||
namespace android {
|
||||
|
||||
const char* cameraPermission = "android.permission.CAMERA";
|
||||
const char* recordAudioPermission = "android.permission.RECORD_AUDIO";
|
||||
|
||||
static bool checkPermission(const char* permissionString) {
|
||||
#ifndef HAVE_ANDROID_OS
|
||||
@@ -86,6 +87,9 @@ status_t MediaRecorderClient::setVideoSource(int vs)
|
||||
status_t MediaRecorderClient::setAudioSource(int as)
|
||||
{
|
||||
LOGV("setAudioSource(%d)", as);
|
||||
if (!checkPermission(recordAudioPermission)) {
|
||||
return PERMISSION_DENIED;
|
||||
}
|
||||
Mutex::Autolock lock(mLock);
|
||||
if (mRecorder == NULL) {
|
||||
LOGE("recorder is not initialized");
|
||||
|
||||
Reference in New Issue
Block a user