summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.h
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-03-04 17:25:57 -0800
committerIgor Murashkin <iam@google.com>2013-03-11 16:32:24 -0700
commite6800cea0678dbc0bf697b44c3e4548b0253085c (patch)
tree5c4cbf3e5ebfff2774270bf9289efd5ce7f53ad0 /services/camera/libcameraservice/CameraService.h
parentfa4cf9d310685b4c25877cba772ff7da84caf517 (diff)
downloadframeworks_av-e6800cea0678dbc0bf697b44c3e4548b0253085c.zip
frameworks_av-e6800cea0678dbc0bf697b44c3e4548b0253085c.tar.gz
frameworks_av-e6800cea0678dbc0bf697b44c3e4548b0253085c.tar.bz2
Camera: Make ProCamera connect take the same paths as Camera connect
* ProCamera uses the app ops manager * Refactored connect calls to be as common as possible * Removed some useless not implemented function calls in ProClient Change-Id: I5dab30d20f0c202a494a07b2cfe4c1fa04a2a076
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r--services/camera/libcameraservice/CameraService.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index d7a336c..c5e495f 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -108,6 +108,7 @@ public:
virtual void disconnect() = 0;
+ // Return the remote callback binder object (e.g. IProCameraCallbacks)
wp<IBinder> getRemote() {
return mRemoteBinder;
}
@@ -247,34 +248,24 @@ public:
return mRemoteCallback;
}
- // BasicClient implementation
- virtual status_t initialize(camera_module_t *module);
-
/***
IProCamera implementation
***/
+ virtual status_t connect(const sp<IProCameraCallbacks>& callbacks)
+ = 0;
+ virtual status_t exclusiveTryLock() = 0;
+ virtual status_t exclusiveLock() = 0;
+ virtual status_t exclusiveUnlock() = 0;
-
- virtual status_t connect(
- const sp<IProCameraCallbacks>& callbacks);
- virtual void disconnect();
-
- virtual status_t exclusiveTryLock();
- virtual status_t exclusiveLock();
- virtual status_t exclusiveUnlock();
-
- virtual bool hasExclusiveLock();
+ virtual bool hasExclusiveLock() = 0;
// Note that the callee gets a copy of the metadata.
virtual int submitRequest(camera_metadata_t* metadata,
- bool streaming = false);
- virtual status_t cancelRequest(int requestId);
-
- virtual status_t requestStream(int streamId);
- virtual status_t cancelStream(int streamId);
+ bool streaming = false) = 0;
+ virtual status_t cancelRequest(int requestId) = 0;
// Callbacks from camera service
- virtual void onExclusiveLockStolen();
+ virtual void onExclusiveLockStolen() = 0;
protected:
virtual void notifyError();
@@ -287,6 +278,22 @@ private:
// Delay-load the Camera HAL module
virtual void onFirstRef();
+ // Step 1. Check if we can connect, before we acquire the service lock.
+ bool validateConnect(int cameraId,
+ /*inout*/
+ int& clientUid) const;
+
+ // Step 2. Check if we can connect, after we acquire the service lock.
+ bool canConnectUnsafe(int cameraId,
+ const String16& clientPackageName,
+ const sp<IBinder>& remoteCallback,
+ /*out*/
+ sp<Client> &client);
+
+ // When connection is successful, initialize client and track its death
+ bool connectFinishUnsafe(const sp<BasicClient>& client,
+ const sp<IBinder>& clientBinder);
+
virtual sp<BasicClient> getClientByRemote(const wp<IBinder>& cameraClient);
Mutex mServiceLock;