diff options
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r-- | services/camera/libcameraservice/CameraService.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index 7f4d43f..cd97b08 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -24,6 +24,7 @@ #include <binder/BinderService.h> #include <binder/IAppOpsCallback.h> #include <camera/ICameraService.h> +#include <camera/ICameraServiceProxy.h> #include <hardware/camera.h> #include <camera/ICamera.h> @@ -74,6 +75,8 @@ public: // Process state (mirrors frameworks/base/core/java/android/app/ActivityManager.java) static const int PROCESS_STATE_NONEXISTENT = -1; + static const int PROCESS_STATE_TOP = 2; + static const int PROCESS_STATE_TOP_SLEEPING = 5; // 3 second busy timeout when other clients are connecting static const nsecs_t DEFAULT_CONNECT_TIMEOUT_NS = 3000000000; @@ -164,6 +167,14 @@ public: void playSound(sound_kind kind); void releaseSound(); + /** + * Update the state of a given camera device (open/close/active/idle) with + * the camera proxy service in the system service + */ + static void updateProxyDeviceState( + ICameraServiceProxy::CameraState newState, + const String8& cameraId); + ///////////////////////////////////////////////////////////////////// // CameraDeviceFactory functionality int getDeviceVersion(int cameraId, int* facing = NULL); @@ -648,8 +659,10 @@ private: sp<CameraFlashlight> mFlashlight; // guard mTorchStatusMap Mutex mTorchStatusMutex; - // guard mTorchClientMap, mTorchUidMap + // guard mTorchClientMap Mutex mTorchClientMapMutex; + // guard mTorchUidMap + Mutex mTorchUidMapMutex; // camera id -> torch status KeyedVector<String8, ICameraServiceListener::TorchStatus> mTorchStatusMap; // camera id -> torch client binder @@ -728,6 +741,7 @@ private: static String8 toString(std::set<userid_t> intSet); + static sp<ICameraServiceProxy> getCameraServiceProxy(); static void pingCameraServiceProxy(); }; @@ -859,11 +873,6 @@ status_t CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String return ret; } - sp<IBinder> remoteCallback = client->getRemote(); - if (remoteCallback != nullptr) { - remoteCallback->linkToDeath(this); - } - // Update shim paremeters for legacy clients if (effectiveApiLevel == API_1) { // Assume we have always received a Client subclass for API1 |