summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camera/Camera.cpp3
-rw-r--r--camera/CameraBase.cpp11
-rw-r--r--camera/ICameraService.cpp81
-rw-r--r--camera/ProCamera.cpp4
-rw-r--r--include/camera/Camera.h6
-rw-r--r--include/camera/CameraBase.h7
-rw-r--r--include/camera/ICameraService.h18
-rw-r--r--include/camera/ProCamera.h7
-rw-r--r--services/camera/libcameraservice/CameraService.cpp121
-rw-r--r--services/camera/libcameraservice/CameraService.h24
10 files changed, 184 insertions, 98 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp
index fd78572..22016a9 100644
--- a/camera/Camera.cpp
+++ b/camera/Camera.cpp
@@ -39,6 +39,9 @@ Camera::Camera(int cameraId)
{
}
+CameraTraits<Camera>::TCamConnectService CameraTraits<Camera>::fnConnectService =
+ &ICameraService::connect;
+
// construct a camera client from an existing camera remote
sp<Camera> Camera::create(const sp<ICamera>& camera)
{
diff --git a/camera/CameraBase.cpp b/camera/CameraBase.cpp
index c25c5fd..55376b0 100644
--- a/camera/CameraBase.cpp
+++ b/camera/CameraBase.cpp
@@ -92,20 +92,25 @@ const sp<ICameraService>& CameraBase<TCam, TCamTraits>::getCameraService()
template <typename TCam, typename TCamTraits>
sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,
- const String16& clientPackageName,
+ const String16& clientPackageName,
int clientUid)
{
ALOGV("%s: connect", __FUNCTION__);
sp<TCam> c = new TCam(cameraId);
sp<TCamCallbacks> cl = c;
+ status_t status = NO_ERROR;
const sp<ICameraService>& cs = getCameraService();
+
if (cs != 0) {
- c->mCamera = cs->connect(cl, cameraId, clientPackageName, clientUid);
+ TCamConnectService fnConnectService = TCamTraits::fnConnectService;
+ status = (cs.get()->*fnConnectService)(cl, cameraId, clientPackageName, clientUid,
+ /*out*/ c->mCamera);
}
- if (c->mCamera != 0) {
+ if (status == OK && c->mCamera != 0) {
c->mCamera->asBinder()->linkToDeath(c);
c->mStatus = NO_ERROR;
} else {
+ ALOGW("An error occurred while connecting to camera: %d", cameraId);
c.clear();
}
return c;
diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp
index 876a2df..3debe22 100644
--- a/camera/ICameraService.cpp
+++ b/camera/ICameraService.cpp
@@ -120,8 +120,10 @@ public:
}
// connect to camera service (android.hardware.Camera)
- virtual sp<ICamera> connect(const sp<ICameraClient>& cameraClient, int cameraId,
- const String16 &clientPackageName, int clientUid)
+ virtual status_t connect(const sp<ICameraClient>& cameraClient, int cameraId,
+ const String16 &clientPackageName, int clientUid,
+ /*out*/
+ sp<ICamera>& device)
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
@@ -131,13 +133,19 @@ public:
data.writeInt32(clientUid);
remote()->transact(BnCameraService::CONNECT, data, &reply);
- if (readExceptionCode(reply)) return NULL;
- return interface_cast<ICamera>(reply.readStrongBinder());
+ if (readExceptionCode(reply)) return -EPROTO;
+ status_t status = reply.readInt32();
+ if (reply.readInt32() != 0) {
+ device = interface_cast<ICamera>(reply.readStrongBinder());
+ }
+ return status;
}
// connect to camera service (pro client)
- virtual sp<IProCameraUser> connect(const sp<IProCameraCallbacks>& cameraCb, int cameraId,
- const String16 &clientPackageName, int clientUid)
+ virtual status_t connectPro(const sp<IProCameraCallbacks>& cameraCb, int cameraId,
+ const String16 &clientPackageName, int clientUid,
+ /*out*/
+ sp<IProCameraUser>& device)
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
@@ -147,16 +155,22 @@ public:
data.writeInt32(clientUid);
remote()->transact(BnCameraService::CONNECT_PRO, data, &reply);
- if (readExceptionCode(reply)) return NULL;
- return interface_cast<IProCameraUser>(reply.readStrongBinder());
+ if (readExceptionCode(reply)) return -EPROTO;
+ status_t status = reply.readInt32();
+ if (reply.readInt32() != 0) {
+ device = interface_cast<IProCameraUser>(reply.readStrongBinder());
+ }
+ return status;
}
// connect to camera service (android.hardware.camera2.CameraDevice)
- virtual sp<ICameraDeviceUser> connect(
+ virtual status_t connectDevice(
const sp<ICameraDeviceCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid)
+ int clientUid,
+ /*out*/
+ sp<ICameraDeviceUser>& device)
{
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
@@ -166,8 +180,12 @@ public:
data.writeInt32(clientUid);
remote()->transact(BnCameraService::CONNECT_DEVICE, data, &reply);
- if (readExceptionCode(reply)) return NULL;
- return interface_cast<ICameraDeviceUser>(reply.readStrongBinder());
+ if (readExceptionCode(reply)) return -EPROTO;
+ status_t status = reply.readInt32();
+ if (reply.readInt32() != 0) {
+ device = interface_cast<ICameraDeviceUser>(reply.readStrongBinder());
+ }
+ return status;
}
virtual status_t addListener(const sp<ICameraServiceListener>& listener)
@@ -228,10 +246,17 @@ status_t BnCameraService::onTransact(
int32_t cameraId = data.readInt32();
const String16 clientName = data.readString16();
int32_t clientUid = data.readInt32();
- sp<ICamera> camera = connect(cameraClient, cameraId,
- clientName, clientUid);
+ sp<ICamera> camera;
+ status_t status = connect(cameraClient, cameraId,
+ clientName, clientUid, /*out*/ camera);
reply->writeNoException();
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeInt32(status);
+ if (camera != NULL) {
+ reply->writeInt32(1);
+ reply->writeStrongBinder(camera->asBinder());
+ } else {
+ reply->writeInt32(0);
+ }
return NO_ERROR;
} break;
case CONNECT_PRO: {
@@ -241,10 +266,17 @@ status_t BnCameraService::onTransact(
int32_t cameraId = data.readInt32();
const String16 clientName = data.readString16();
int32_t clientUid = data.readInt32();
- sp<IProCameraUser> camera = connect(cameraClient, cameraId,
- clientName, clientUid);
+ sp<IProCameraUser> camera;
+ status_t status = connectPro(cameraClient, cameraId,
+ clientName, clientUid, /*out*/ camera);
reply->writeNoException();
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeInt32(status);
+ if (camera != NULL) {
+ reply->writeInt32(1);
+ reply->writeStrongBinder(camera->asBinder());
+ } else {
+ reply->writeInt32(0);
+ }
return NO_ERROR;
} break;
case CONNECT_DEVICE: {
@@ -254,10 +286,17 @@ status_t BnCameraService::onTransact(
int32_t cameraId = data.readInt32();
const String16 clientName = data.readString16();
int32_t clientUid = data.readInt32();
- sp<ICameraDeviceUser> camera = connect(cameraClient, cameraId,
- clientName, clientUid);
+ sp<ICameraDeviceUser> camera;
+ status_t status = connectDevice(cameraClient, cameraId,
+ clientName, clientUid, /*out*/ camera);
reply->writeNoException();
- reply->writeStrongBinder(camera->asBinder());
+ reply->writeInt32(status);
+ if (camera != NULL) {
+ reply->writeInt32(1);
+ reply->writeStrongBinder(camera->asBinder());
+ } else {
+ reply->writeInt32(0);
+ }
return NO_ERROR;
} break;
case ADD_LISTENER: {
diff --git a/camera/ProCamera.cpp b/camera/ProCamera.cpp
index f6c9ca1..577c760 100644
--- a/camera/ProCamera.cpp
+++ b/camera/ProCamera.cpp
@@ -26,7 +26,6 @@
#include <binder/IMemory.h>
#include <camera/ProCamera.h>
-#include <camera/ICameraService.h>
#include <camera/IProCameraUser.h>
#include <camera/IProCameraCallbacks.h>
@@ -47,6 +46,9 @@ ProCamera::ProCamera(int cameraId)
{
}
+CameraTraits<ProCamera>::TCamConnectService CameraTraits<ProCamera>::fnConnectService =
+ &ICameraService::connectPro;
+
ProCamera::~ProCamera()
{
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index c34b3ea..81848b3 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -51,8 +51,14 @@ struct CameraTraits<Camera>
typedef CameraListener TCamListener;
typedef ICamera TCamUser;
typedef ICameraClient TCamCallbacks;
+ typedef status_t (ICameraService::*TCamConnectService)(const sp<ICameraClient>&,
+ int, const String16&, int,
+ /*out*/
+ sp<ICamera>&);
+ static TCamConnectService fnConnectService;
};
+
class Camera :
public CameraBase<Camera>,
public BnCameraClient
diff --git a/include/camera/CameraBase.h b/include/camera/CameraBase.h
index 9b08c0f..1b93157 100644
--- a/include/camera/CameraBase.h
+++ b/include/camera/CameraBase.h
@@ -54,9 +54,10 @@ template <typename TCam, typename TCamTraits = CameraTraits<TCam> >
class CameraBase : public IBinder::DeathRecipient
{
public:
- typedef typename TCamTraits::TCamListener TCamListener;
- typedef typename TCamTraits::TCamUser TCamUser;
- typedef typename TCamTraits::TCamCallbacks TCamCallbacks;
+ typedef typename TCamTraits::TCamListener TCamListener;
+ typedef typename TCamTraits::TCamUser TCamUser;
+ typedef typename TCamTraits::TCamCallbacks TCamCallbacks;
+ typedef typename TCamTraits::TCamConnectService TCamConnectService;
static sp<TCam> connect(int cameraId,
const String16& clientPackageName,
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h
index fa715b7..0e10699 100644
--- a/include/camera/ICameraService.h
+++ b/include/camera/ICameraService.h
@@ -71,21 +71,27 @@ public:
* clientUid == USE_CALLING_UID, then the calling UID is used instead. Only
* trusted callers can set a clientUid other than USE_CALLING_UID.
*/
- virtual sp<ICamera> connect(const sp<ICameraClient>& cameraClient,
+ virtual status_t connect(const sp<ICameraClient>& cameraClient,
int cameraId,
const String16& clientPackageName,
- int clientUid) = 0;
+ int clientUid,
+ /*out*/
+ sp<ICamera>& device) = 0;
- virtual sp<IProCameraUser> connect(const sp<IProCameraCallbacks>& cameraCb,
+ virtual status_t connectPro(const sp<IProCameraCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid) = 0;
+ int clientUid,
+ /*out*/
+ sp<IProCameraUser>& device) = 0;
- virtual sp<ICameraDeviceUser> connect(
+ virtual status_t connectDevice(
const sp<ICameraDeviceCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid) = 0;
+ int clientUid,
+ /*out*/
+ sp<ICameraDeviceUser>& device) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/camera/ProCamera.h b/include/camera/ProCamera.h
index 3d1652f..d9ee662 100644
--- a/include/camera/ProCamera.h
+++ b/include/camera/ProCamera.h
@@ -25,6 +25,7 @@
#include <camera/IProCameraUser.h>
#include <camera/Camera.h>
#include <camera/CameraMetadata.h>
+#include <camera/ICameraService.h>
#include <gui/CpuConsumer.h>
#include <gui/Surface.h>
@@ -87,8 +88,14 @@ struct CameraTraits<ProCamera>
typedef ProCameraListener TCamListener;
typedef IProCameraUser TCamUser;
typedef IProCameraCallbacks TCamCallbacks;
+ typedef status_t (ICameraService::*TCamConnectService)(const sp<IProCameraCallbacks>&,
+ int, const String16&, int,
+ /*out*/
+ sp<IProCameraUser>&);
+ static TCamConnectService fnConnectService;
};
+
class ProCamera :
public CameraBase<ProCamera>,
public BnProCameraCallbacks
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 359b3ca..bf9bc71 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -211,7 +211,7 @@ int32_t CameraService::getNumberOfCameras() {
status_t CameraService::getCameraInfo(int cameraId,
struct CameraInfo* cameraInfo) {
if (!mModule) {
- return NO_INIT;
+ return -ENODEV;
}
if (cameraId < 0 || cameraId >= mNumberOfCameras) {
@@ -262,7 +262,7 @@ bool CameraService::isValidCameraId(int cameraId) {
return false;
}
-bool CameraService::validateConnect(int cameraId,
+status_t CameraService::validateConnect(int cameraId,
/*inout*/
int& clientUid) const {
@@ -275,19 +275,19 @@ bool CameraService::validateConnect(int cameraId,
if (callingPid != getpid()) {
ALOGE("CameraService::connect X (pid %d) rejected (don't trust clientUid)",
callingPid);
- return false;
+ return PERMISSION_DENIED;
}
}
if (!mModule) {
ALOGE("Camera HAL module not loaded");
- return false;
+ return -ENODEV;
}
if (cameraId < 0 || cameraId >= mNumberOfCameras) {
ALOGE("CameraService::connect X (pid %d) rejected (invalid cameraId %d).",
callingPid, cameraId);
- return false;
+ return -ENODEV;
}
char value[PROPERTY_VALUE_MAX];
@@ -295,23 +295,23 @@ bool CameraService::validateConnect(int cameraId,
if (strcmp(value, "1") == 0) {
// Camera is disabled by DevicePolicyManager.
ALOGI("Camera is disabled. connect X (pid %d) rejected", callingPid);
- return false;
+ return -EACCES;
}
ICameraServiceListener::Status currentStatus = getStatus(cameraId);
if (currentStatus == ICameraServiceListener::STATUS_NOT_PRESENT) {
ALOGI("Camera is not plugged in,"
" connect X (pid %d) rejected", callingPid);
- return false;
+ return -ENODEV;
} else if (currentStatus == ICameraServiceListener::STATUS_ENUMERATING) {
ALOGI("Camera is enumerating,"
" connect X (pid %d) rejected", callingPid);
- return false;
+ return -EBUSY;
}
// Else don't check for STATUS_NOT_AVAILABLE.
// -- It's done implicitly in canConnectUnsafe /w the mBusy array
- return true;
+ return OK;
}
bool CameraService::canConnectUnsafe(int cameraId,
@@ -358,11 +358,13 @@ bool CameraService::canConnectUnsafe(int cameraId,
return true;
}
-sp<ICamera> CameraService::connect(
+status_t CameraService::connect(
const sp<ICameraClient>& cameraClient,
int cameraId,
const String16& clientPackageName,
- int clientUid) {
+ int clientUid,
+ /*out*/
+ sp<ICamera>& device) {
String8 clientName8(clientPackageName);
int callingPid = getCallingPid();
@@ -370,8 +372,9 @@ sp<ICamera> CameraService::connect(
LOG1("CameraService::connect E (pid %d \"%s\", id %d)", callingPid,
clientName8.string(), cameraId);
- if (!validateConnect(cameraId, /*inout*/clientUid)) {
- return NULL;
+ status_t status = validateConnect(cameraId, /*inout*/clientUid);
+ if (status != OK) {
+ return status;
}
@@ -382,9 +385,10 @@ sp<ICamera> CameraService::connect(
if (!canConnectUnsafe(cameraId, clientPackageName,
cameraClient->asBinder(),
/*out*/clientTmp)) {
- return NULL;
+ return -EBUSY;
} else if (client.get() != NULL) {
- return static_cast<Client*>(clientTmp.get());
+ device = static_cast<Client*>(clientTmp.get());
+ return OK;
}
int facing = -1;
@@ -414,19 +418,18 @@ sp<ICamera> CameraService::connect(
break;
case -1:
ALOGE("Invalid camera id %d", cameraId);
- return NULL;
+ return BAD_VALUE;
default:
ALOGE("Unknown camera device HAL version: %d", deviceVersion);
- return NULL;
+ return INVALID_OPERATION;
}
- if (!connectFinishUnsafe(client,
- client->getRemote())) {
+ status_t status = connectFinishUnsafe(client, client->getRemote());
+ if (status != OK) {
// this is probably not recoverable.. maybe the client can try again
// OK: we can only get here if we were originally in PRESENT state
updateStatus(ICameraServiceListener::STATUS_PRESENT, cameraId);
-
- return NULL;
+ return status;
}
mClient[cameraId] = client;
@@ -436,34 +439,38 @@ sp<ICamera> CameraService::connect(
// important: release the mutex here so the client can call back
// into the service from its destructor (can be at the end of the call)
- return client;
+ device = client;
+ return OK;
}
-bool CameraService::connectFinishUnsafe(const sp<BasicClient>& client,
- const sp<IBinder>& remoteCallback) {
- if (client->initialize(mModule) != OK) {
- return false;
+status_t CameraService::connectFinishUnsafe(const sp<BasicClient>& client,
+ const sp<IBinder>& remoteCallback) {
+ status_t status = client->initialize(mModule);
+ if (status != OK) {
+ return status;
}
remoteCallback->linkToDeath(this);
- return true;
+ return OK;
}
-sp<IProCameraUser> CameraService::connect(
+status_t CameraService::connectPro(
const sp<IProCameraCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid)
+ int clientUid,
+ /*out*/
+ sp<IProCameraUser>& device)
{
String8 clientName8(clientPackageName);
int callingPid = getCallingPid();
LOG1("CameraService::connectPro E (pid %d \"%s\", id %d)", callingPid,
clientName8.string(), cameraId);
-
- if (!validateConnect(cameraId, /*inout*/clientUid)) {
- return NULL;
+ status_t status = validateConnect(cameraId, /*inout*/clientUid);
+ if (status != OK) {
+ return status;
}
sp<ProClient> client;
@@ -474,7 +481,7 @@ sp<IProCameraUser> CameraService::connect(
if (!canConnectUnsafe(cameraId, clientPackageName,
cameraCb->asBinder(),
/*out*/client)) {
- return NULL;
+ return -EBUSY;
}
}
@@ -485,7 +492,7 @@ sp<IProCameraUser> CameraService::connect(
case CAMERA_DEVICE_API_VERSION_1_0:
ALOGE("Camera id %d uses HALv1, doesn't support ProCamera",
cameraId);
- return NULL;
+ return -ENOTSUP;
break;
case CAMERA_DEVICE_API_VERSION_2_0:
case CAMERA_DEVICE_API_VERSION_2_1:
@@ -495,14 +502,15 @@ sp<IProCameraUser> CameraService::connect(
break;
case -1:
ALOGE("Invalid camera id %d", cameraId);
- return NULL;
+ return BAD_VALUE;
default:
ALOGE("Unknown camera device HAL version: %d", deviceVersion);
- return NULL;
+ return INVALID_OPERATION;
}
- if (!connectFinishUnsafe(client, client->getRemote())) {
- return NULL;
+ status_t status = connectFinishUnsafe(client, client->getRemote());
+ if (status != OK) {
+ return status;
}
mProClientList[cameraId].push(client);
@@ -512,18 +520,18 @@ sp<IProCameraUser> CameraService::connect(
}
// important: release the mutex here so the client can call back
// into the service from its destructor (can be at the end of the call)
-
- return client;
+ device = client;
+ return OK;
}
-sp<ICameraDeviceUser> CameraService::connect(
+status_t CameraService::connectDevice(
const sp<ICameraDeviceCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid)
+ int clientUid,
+ /*out*/
+ sp<ICameraDeviceUser>& device)
{
- // TODO: this function needs to return status_t
- // so that we have an error code when things go wrong and the client is NULL
String8 clientName8(clientPackageName);
int callingPid = getCallingPid();
@@ -531,8 +539,9 @@ sp<ICameraDeviceUser> CameraService::connect(
LOG1("CameraService::connectDevice E (pid %d \"%s\", id %d)", callingPid,
clientName8.string(), cameraId);
- if (!validateConnect(cameraId, /*inout*/clientUid)) {
- return NULL;
+ status_t status = validateConnect(cameraId, /*inout*/clientUid);
+ if (status != OK) {
+ return status;
}
sp<CameraDeviceClient> client;
@@ -543,7 +552,7 @@ sp<ICameraDeviceUser> CameraService::connect(
if (!canConnectUnsafe(cameraId, clientPackageName,
cameraCb->asBinder(),
/*out*/client)) {
- return NULL;
+ return -EBUSY;
}
}
@@ -560,10 +569,8 @@ sp<ICameraDeviceUser> CameraService::connect(
switch(deviceVersion) {
case CAMERA_DEVICE_API_VERSION_1_0:
- ALOGE("Camera id %d uses old HAL, doesn't support CameraDevice",
- cameraId);
- return NULL;
- break;
+ ALOGW("Camera using old HAL version: %d", deviceVersion);
+ return -ENOTSUP;
// TODO: don't allow 2.0 Only allow 2.1 and higher
case CAMERA_DEVICE_API_VERSION_2_0:
case CAMERA_DEVICE_API_VERSION_2_1:
@@ -573,17 +580,18 @@ sp<ICameraDeviceUser> CameraService::connect(
break;
case -1:
ALOGE("Invalid camera id %d", cameraId);
- return NULL;
+ return BAD_VALUE;
default:
ALOGE("Unknown camera device HAL version: %d", deviceVersion);
- return NULL;
+ return INVALID_OPERATION;
}
- if (!connectFinishUnsafe(client, client->getRemote())) {
+ status_t status = connectFinishUnsafe(client, client->getRemote());
+ if (status != OK) {
// this is probably not recoverable.. maybe the client can try again
// OK: we can only get here if we were originally in PRESENT state
updateStatus(ICameraServiceListener::STATUS_PRESENT, cameraId);
- return NULL;
+ return status;
}
LOG1("CameraService::connectDevice X (id %d, this pid is %d)", cameraId,
@@ -594,7 +602,8 @@ sp<ICameraDeviceUser> CameraService::connect(
// important: release the mutex here so the client can call back
// into the service from its destructor (can be at the end of the call)
- return client;
+ device = client;
+ return OK;
}
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 980eb97..3921cbd 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -72,15 +72,23 @@ public:
virtual status_t getCameraInfo(int cameraId,
struct CameraInfo* cameraInfo);
- virtual sp<ICamera> connect(const sp<ICameraClient>& cameraClient, int cameraId,
- const String16& clientPackageName, int clientUid);
- virtual sp<IProCameraUser> connect(const sp<IProCameraCallbacks>& cameraCb,
- int cameraId, const String16& clientPackageName, int clientUid);
- virtual sp<ICameraDeviceUser> connect(
+ virtual status_t connect(const sp<ICameraClient>& cameraClient, int cameraId,
+ const String16& clientPackageName, int clientUid,
+ /*out*/
+ sp<ICamera>& device);
+
+ virtual status_t connectPro(const sp<IProCameraCallbacks>& cameraCb,
+ int cameraId, const String16& clientPackageName, int clientUid,
+ /*out*/
+ sp<IProCameraUser>& device);
+
+ virtual status_t connectDevice(
const sp<ICameraDeviceCallbacks>& cameraCb,
int cameraId,
const String16& clientPackageName,
- int clientUid);
+ int clientUid,
+ /*out*/
+ sp<ICameraDeviceUser>& device);
virtual status_t addListener(const sp<ICameraServiceListener>& listener);
virtual status_t removeListener(
@@ -308,7 +316,7 @@ private:
virtual void onFirstRef();
// Step 1. Check if we can connect, before we acquire the service lock.
- bool validateConnect(int cameraId,
+ status_t validateConnect(int cameraId,
/*inout*/
int& clientUid) const;
@@ -320,7 +328,7 @@ private:
sp<BasicClient> &client);
// When connection is successful, initialize client and track its death
- bool connectFinishUnsafe(const sp<BasicClient>& client,
+ status_t connectFinishUnsafe(const sp<BasicClient>& client,
const sp<IBinder>& remoteCallback);
virtual sp<BasicClient> getClientByRemote(const wp<IBinder>& cameraClient);