diff options
author | Chien-Yu Chen <cychen@google.com> | 2015-02-09 13:29:57 -0800 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2015-03-17 19:23:48 -0700 |
commit | 736a7f7b39637e67becef203bb552010ba071467 (patch) | |
tree | c1ae9b6f502ec163c24beebdac913ab0ce72e154 /camera/ICameraServiceListener.cpp | |
parent | 2f9c62f3e838f358bd5921270d7b1dec39e0a974 (diff) | |
download | frameworks_av-736a7f7b39637e67becef203bb552010ba071467.zip frameworks_av-736a7f7b39637e67becef203bb552010ba071467.tar.gz frameworks_av-736a7f7b39637e67becef203bb552010ba071467.tar.bz2 |
camera: implement flashlight control
Implement flashlight API for module v2.4 by calling module APIs and
by for hal v2 and v3 by using CameraDeviceBase.
Bug: 2682206
Change-Id: Ib8b77f6fd462489d672f27e14fe37801d35b7544
Diffstat (limited to 'camera/ICameraServiceListener.cpp')
-rw-r--r-- | camera/ICameraServiceListener.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/camera/ICameraServiceListener.cpp b/camera/ICameraServiceListener.cpp index b2f1729..90a8bc2 100644 --- a/camera/ICameraServiceListener.cpp +++ b/camera/ICameraServiceListener.cpp @@ -29,6 +29,7 @@ namespace android { namespace { enum { STATUS_CHANGED = IBinder::FIRST_CALL_TRANSACTION, + TORCH_STATUS_CHANGED, }; }; // namespace anonymous @@ -54,8 +55,21 @@ public: data, &reply, IBinder::FLAG_ONEWAY); + } - reply.readExceptionCode(); + virtual void onTorchStatusChanged(TorchStatus status, const String16 &cameraId) + { + Parcel data, reply; + data.writeInterfaceToken( + ICameraServiceListener::getInterfaceDescriptor()); + + data.writeInt32(static_cast<int32_t>(status)); + data.writeString16(cameraId); + + remote()->transact(TORCH_STATUS_CHANGED, + data, + &reply, + IBinder::FLAG_ONEWAY); } }; @@ -75,7 +89,16 @@ status_t BnCameraServiceListener::onTransact( int32_t cameraId = data.readInt32(); onStatusChanged(status, cameraId); - reply->writeNoException(); + + return NO_ERROR; + } break; + case TORCH_STATUS_CHANGED: { + CHECK_INTERFACE(ICameraServiceListener, data, reply); + + TorchStatus status = static_cast<TorchStatus>(data.readInt32()); + String16 cameraId = data.readString16(); + + onTorchStatusChanged(status, cameraId); return NO_ERROR; } break; |