diff options
author | Chien-Yu Chen <cychen@google.com> | 2015-03-03 22:20:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-03 22:20:38 +0000 |
commit | 38445e493d4cab2abc29515fd3f2ce2e411a6868 (patch) | |
tree | 09303b3079864d8a921d45c14d591addb25ee965 /services/camera/libcameraservice/CameraService.h | |
parent | d702a568cb62e5aebe048147350bb3c76f9386ba (diff) | |
parent | 88da526d97442c80731e01bfc94c6b47c4b0c3c7 (diff) | |
download | frameworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.zip frameworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.tar.gz frameworks_av-38445e493d4cab2abc29515fd3f2ce2e411a6868.tar.bz2 |
Merge "camera: fix flashlight implementation for HAL v2"
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r-- | services/camera/libcameraservice/CameraService.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index 84bcdb8..74b3623 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -72,7 +72,7 @@ public: // HAL Callbacks virtual void onDeviceStatusChanged(int cameraId, int newStatus); - virtual void onTorchStatusChanged(const String16& cameraId, + virtual void onTorchStatusChanged(const String8& cameraId, ICameraServiceListener::TorchStatus newStatus); @@ -418,28 +418,33 @@ private: // flashlight control sp<CameraFlashlight> mFlashlight; - // guard mTorchStatusMap and mTorchClientMap + // guard mTorchStatusMap Mutex mTorchStatusMutex; + // guard mTorchClientMap + Mutex mTorchClientMapMutex; // camera id -> torch status - KeyedVector<String16, ICameraServiceListener::TorchStatus> mTorchStatusMap; + KeyedVector<String8, ICameraServiceListener::TorchStatus> mTorchStatusMap; // camera id -> torch client binder // only store the last client that turns on each camera's torch mode - KeyedVector<String16, sp<IBinder> > mTorchClientMap; + KeyedVector<String8, sp<IBinder> > mTorchClientMap; // check and handle if torch client's process has died void handleTorchClientBinderDied(const wp<IBinder> &who); // handle torch mode status change and invoke callbacks. mTorchStatusMutex // should be locked. - void onTorchStatusChangedLocked(const String16& cameraId, + void onTorchStatusChangedLocked(const String8& cameraId, ICameraServiceListener::TorchStatus newStatus); + // validate the camera id for use of setting a torch mode. + bool validCameraIdForSetTorchMode(const String8& cameraId); + // get a camera's torch status. mTorchStatusMutex should be locked. - ICameraServiceListener::TorchStatus getTorchStatusLocked( - const String16 &cameraId) const; + status_t getTorchStatusLocked(const String8 &cameraId, + ICameraServiceListener::TorchStatus *status) const; // set a camera's torch status. mTorchStatusMutex should be locked. - status_t setTorchStatusLocked(const String16 &cameraId, + status_t setTorchStatusLocked(const String8 &cameraId, ICameraServiceListener::TorchStatus status); // IBinder::DeathRecipient implementation |