summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-08-20 17:08:32 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-08-21 17:41:43 -0700
commit412fe56cd7cf7d73bc5d2bcc3f635bc650d18de9 (patch)
tree919a0a09510d53e39c23126f7d4760d761d954d6 /camera
parent37ea1d0de9b7c9ffbfa7cb1895dcbf4a4f92803a (diff)
downloadframeworks_av-412fe56cd7cf7d73bc5d2bcc3f635bc650d18de9.zip
frameworks_av-412fe56cd7cf7d73bc5d2bcc3f635bc650d18de9.tar.gz
frameworks_av-412fe56cd7cf7d73bc5d2bcc3f635bc650d18de9.tar.bz2
CameraService: Notify camera service proxy of device status
Send the camera proxy service in system server updates to camera device state: opened/closed/active/idle. Bug: 23393557 Change-Id: Id7c70f134821efa34af8f6e7b4caa4c2ab128ebc
Diffstat (limited to 'camera')
-rw-r--r--camera/ICameraServiceProxy.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/camera/ICameraServiceProxy.cpp b/camera/ICameraServiceProxy.cpp
index 06a5afb..694e9c3 100644
--- a/camera/ICameraServiceProxy.cpp
+++ b/camera/ICameraServiceProxy.cpp
@@ -29,11 +29,21 @@ public:
BpCameraServiceProxy(const sp<IBinder>& impl) : BpInterface<ICameraServiceProxy>(impl) {}
virtual void pingForUserUpdate() {
- Parcel data, reply;
+ Parcel data;
data.writeInterfaceToken(ICameraServiceProxy::getInterfaceDescriptor());
- remote()->transact(BnCameraServiceProxy::PING_FOR_USER_UPDATE, data, &reply,
+ remote()->transact(BnCameraServiceProxy::PING_FOR_USER_UPDATE, data, nullptr,
IBinder::FLAG_ONEWAY);
}
+
+ virtual void notifyCameraState(String16 cameraId, CameraState newCameraState) {
+ Parcel data;
+ data.writeInterfaceToken(ICameraServiceProxy::getInterfaceDescriptor());
+ data.writeString16(cameraId);
+ data.writeInt32(newCameraState);
+ remote()->transact(BnCameraServiceProxy::NOTIFY_CAMERA_STATE, data, nullptr,
+ IBinder::FLAG_ONEWAY);
+ }
+
};
@@ -47,9 +57,16 @@ status_t BnCameraServiceProxy::onTransact(uint32_t code, const Parcel& data, Par
pingForUserUpdate();
return NO_ERROR;
} break;
+ case NOTIFY_CAMERA_STATE: {
+ CHECK_INTERFACE(ICameraServiceProxy, data, reply);
+ String16 cameraId = data.readString16();
+ CameraState newCameraState =
+ static_cast<CameraState>(data.readInt32());
+ notifyCameraState(cameraId, newCameraState);
+ return NO_ERROR;
+ } break;
default:
return BBinder::onTransact(code, data, reply, flags);
}
}
}; // namespace android
-