summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2013-02-19 10:40:14 -0800
committerEino-Ville Talvala <etalvala@google.com>2013-02-25 16:11:41 -0800
commitceb388d6c03c38b96dc41c0ea4804b749aa077c4 (patch)
tree0639ba70ce330094a9fa71ba4577eece6d4dadb1 /media/libmediaplayerservice/StagefrightRecorder.cpp
parent0894bfb78b7872570b94d0b8d23ebbf6a8b51d35 (diff)
downloadframeworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.zip
frameworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.tar.gz
frameworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.tar.bz2
CameraService and Stagefright: Support AppOps
Camera: - Signal to AppOpsService when camera usage starts and stops - Listen to permissions revocations and act on them - Currently just kill camera connection when permissions lost Stagefright: - Pass on client name, UID to camera as needed Bug: 8181262 Change-Id: I9e33c9d05e9daa77dbb2d795045d08eb887ec8f0
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 497dda6..f570856 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -730,6 +730,12 @@ status_t StagefrightRecorder::setListener(const sp<IMediaRecorderClient> &listen
return OK;
}
+status_t StagefrightRecorder::setClientName(const String16& clientName) {
+ mClientName = clientName;
+
+ return OK;
+}
+
status_t StagefrightRecorder::prepare() {
return OK;
}
@@ -737,6 +743,8 @@ status_t StagefrightRecorder::prepare() {
status_t StagefrightRecorder::start() {
CHECK_GE(mOutputFd, 0);
+ // Get UID here for permission checking
+ mClientUid = IPCThreadState::self()->getCallingUid();
if (mWriter != NULL) {
ALOGE("File writer is not avaialble");
return UNKNOWN_ERROR;
@@ -1312,13 +1320,14 @@ status_t StagefrightRecorder::setupCameraSource(
}
mCameraSourceTimeLapse = CameraSourceTimeLapse::CreateFromCamera(
- mCamera, mCameraProxy, mCameraId,
+ mCamera, mCameraProxy, mCameraId, mClientName, mClientUid,
videoSize, mFrameRate, mPreviewSurface,
mTimeBetweenTimeLapseFrameCaptureUs);
*cameraSource = mCameraSourceTimeLapse;
} else {
*cameraSource = CameraSource::CreateFromCamera(
- mCamera, mCameraProxy, mCameraId, videoSize, mFrameRate,
+ mCamera, mCameraProxy, mCameraId, mClientName, mClientUid,
+ videoSize, mFrameRate,
mPreviewSurface, true /*storeMetaDataInVideoBuffers*/);
}
mCamera.clear();