diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-05-01 20:47:20 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2015-05-02 17:18:47 -0700 |
commit | 32fa6d0e65dbf956e253a1006e9419dce2fe75c9 (patch) | |
tree | 35bdbc743172f28de3167d7b800a6084e5c9c58d /camera | |
parent | 4068b1392b18d9f0d9e866b50d716e2ef8dfa37c (diff) | |
download | frameworks_av-32fa6d0e65dbf956e253a1006e9419dce2fe75c9.zip frameworks_av-32fa6d0e65dbf956e253a1006e9419dce2fe75c9.tar.gz frameworks_av-32fa6d0e65dbf956e253a1006e9419dce2fe75c9.tar.bz2 |
Add camera app op - camera
Change-Id: I26570cc0a23fdea740b416a26838d40cac296c85
Diffstat (limited to 'camera')
-rw-r--r-- | camera/Camera.cpp | 9 | ||||
-rw-r--r-- | camera/CameraBase.cpp | 4 | ||||
-rw-r--r-- | camera/ICameraService.cpp | 24 |
3 files changed, 18 insertions, 19 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp index 3a9fb4c..84e0d1c 100644 --- a/camera/Camera.cpp +++ b/camera/Camera.cpp @@ -71,14 +71,13 @@ Camera::~Camera() // deadlock if we call any method of ICamera here. } -sp<Camera> Camera::connect(int cameraId, const String16& clientPackageName, - int clientUid) +sp<Camera> Camera::connect(int cameraId, const String16& opPackageName, int clientUid) { - return CameraBaseT::connect(cameraId, clientPackageName, clientUid); + return CameraBaseT::connect(cameraId, opPackageName, clientUid); } status_t Camera::connectLegacy(int cameraId, int halVersion, - const String16& clientPackageName, + const String16& opPackageName, int clientUid, sp<Camera>& camera) { @@ -89,7 +88,7 @@ status_t Camera::connectLegacy(int cameraId, int halVersion, const sp<ICameraService>& cs = CameraBaseT::getCameraService(); if (cs != 0) { - status = cs.get()->connectLegacy(cl, cameraId, halVersion, clientPackageName, + status = cs.get()->connectLegacy(cl, cameraId, halVersion, opPackageName, clientUid, /*out*/c->mCamera); } if (status == OK && c->mCamera != 0) { diff --git a/camera/CameraBase.cpp b/camera/CameraBase.cpp index 5d50aa8..0dc0276 100644 --- a/camera/CameraBase.cpp +++ b/camera/CameraBase.cpp @@ -91,7 +91,7 @@ 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& opPackageName, int clientUid) { ALOGV("%s: connect", __FUNCTION__); @@ -102,7 +102,7 @@ sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId, if (cs != 0) { TCamConnectService fnConnectService = TCamTraits::fnConnectService; - status = (cs.get()->*fnConnectService)(cl, cameraId, clientPackageName, clientUid, + status = (cs.get()->*fnConnectService)(cl, cameraId, opPackageName, clientUid, /*out*/ c->mCamera); } if (status == OK && c->mCamera != 0) { diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp index 51a775b..192e40d 100644 --- a/camera/ICameraService.cpp +++ b/camera/ICameraService.cpp @@ -164,7 +164,7 @@ public: // connect to camera service (android.hardware.Camera) virtual status_t connect(const sp<ICameraClient>& cameraClient, int cameraId, - const String16 &clientPackageName, int clientUid, + const String16& opPackageName, int clientUid, /*out*/ sp<ICamera>& device) { @@ -172,7 +172,7 @@ public: data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); data.writeStrongBinder(IInterface::asBinder(cameraClient)); data.writeInt32(cameraId); - data.writeString16(clientPackageName); + data.writeString16(opPackageName); data.writeInt32(clientUid); remote()->transact(BnCameraService::CONNECT, data, &reply); @@ -187,7 +187,7 @@ public: // connect to camera service (android.hardware.Camera) virtual status_t connectLegacy(const sp<ICameraClient>& cameraClient, int cameraId, int halVersion, - const String16 &clientPackageName, int clientUid, + const String16& opPackageName, int clientUid, /*out*/sp<ICamera>& device) { Parcel data, reply; @@ -195,7 +195,7 @@ public: data.writeStrongBinder(IInterface::asBinder(cameraClient)); data.writeInt32(cameraId); data.writeInt32(halVersion); - data.writeString16(clientPackageName); + data.writeString16(opPackageName); data.writeInt32(clientUid); remote()->transact(BnCameraService::CONNECT_LEGACY, data, &reply); @@ -225,7 +225,7 @@ public: virtual status_t connectDevice( const sp<ICameraDeviceCallbacks>& cameraCb, int cameraId, - const String16& clientPackageName, + const String16& opPackageName, int clientUid, /*out*/ sp<ICameraDeviceUser>& device) @@ -234,7 +234,7 @@ public: data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); data.writeStrongBinder(IInterface::asBinder(cameraCb)); data.writeInt32(cameraId); - data.writeString16(clientPackageName); + data.writeString16(opPackageName); data.writeInt32(clientUid); remote()->transact(BnCameraService::CONNECT_DEVICE, data, &reply); @@ -374,11 +374,11 @@ status_t BnCameraService::onTransact( sp<ICameraClient> cameraClient = interface_cast<ICameraClient>(data.readStrongBinder()); int32_t cameraId = data.readInt32(); - const String16 clientName = data.readString16(); + const String16 opPackageName = data.readString16(); int32_t clientUid = data.readInt32(); sp<ICamera> camera; status_t status = connect(cameraClient, cameraId, - clientName, clientUid, /*out*/camera); + opPackageName, clientUid, /*out*/camera); reply->writeNoException(); reply->writeInt32(status); if (camera != NULL) { @@ -394,11 +394,11 @@ status_t BnCameraService::onTransact( sp<ICameraDeviceCallbacks> cameraClient = interface_cast<ICameraDeviceCallbacks>(data.readStrongBinder()); int32_t cameraId = data.readInt32(); - const String16 clientName = data.readString16(); + const String16 opPackageName = data.readString16(); int32_t clientUid = data.readInt32(); sp<ICameraDeviceUser> camera; status_t status = connectDevice(cameraClient, cameraId, - clientName, clientUid, /*out*/camera); + opPackageName, clientUid, /*out*/camera); reply->writeNoException(); reply->writeInt32(status); if (camera != NULL) { @@ -454,11 +454,11 @@ status_t BnCameraService::onTransact( interface_cast<ICameraClient>(data.readStrongBinder()); int32_t cameraId = data.readInt32(); int32_t halVersion = data.readInt32(); - const String16 clientName = data.readString16(); + const String16 opPackageName = data.readString16(); int32_t clientUid = data.readInt32(); sp<ICamera> camera; status_t status = connectLegacy(cameraClient, cameraId, halVersion, - clientName, clientUid, /*out*/camera); + opPackageName, clientUid, /*out*/camera); reply->writeNoException(); reply->writeInt32(status); if (camera != NULL) { |