Camera: Switch camera2 to auto-gen C++ binder interfaces
- Move camera service AIDL files to frameworks/av
- Build C++ interface stubs with AIDL tools
- Add necessary native-side parcelables and update existing ones
- Remove manually-written stubs, rearrange remaining manual stubs
- Adjust implementations to work with auto-generated stubs
- Adjust method signatures for auto-gen differences
- Add rich error messages using binder::Status
Bug: 25091611
Change-Id: I6f69f34b9d1a3f8d1fb7db87357363f8fa8483ff
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index f19d296..b45bbfc 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -18,13 +18,15 @@
#define ANDROID_HARDWARE_CAMERA_H
#include <utils/Timers.h>
+
+#include <android/hardware/ICameraService.h>
+
#include <gui/IGraphicBufferProducer.h>
#include <system/camera.h>
-#include <camera/ICameraClient.h>
#include <camera/ICameraRecordingProxy.h>
#include <camera/ICameraRecordingProxyListener.h>
-#include <camera/ICameraService.h>
-#include <camera/ICamera.h>
+#include <camera/android/hardware/ICamera.h>
+#include <camera/android/hardware/ICameraClient.h>
#include <camera/CameraBase.h>
namespace android {
@@ -48,31 +50,32 @@
template <>
struct CameraTraits<Camera>
{
- typedef CameraListener TCamListener;
- typedef ICamera TCamUser;
- typedef ICameraClient TCamCallbacks;
- typedef status_t (ICameraService::*TCamConnectService)(const sp<ICameraClient>&,
- int, const String16&, int, int,
- /*out*/
- sp<ICamera>&);
+ typedef CameraListener TCamListener;
+ typedef ::android::hardware::ICamera TCamUser;
+ typedef ::android::hardware::ICameraClient TCamCallbacks;
+ typedef ::android::binder::Status(::android::hardware::ICameraService::*TCamConnectService)
+ (const sp<::android::hardware::ICameraClient>&,
+ int, const String16&, int, int,
+ /*out*/
+ sp<::android::hardware::ICamera>*);
static TCamConnectService fnConnectService;
};
class Camera :
public CameraBase<Camera>,
- public BnCameraClient
+ public ::android::hardware::BnCameraClient
{
public:
enum {
- USE_CALLING_UID = ICameraService::USE_CALLING_UID
+ USE_CALLING_UID = ::android::hardware::ICameraService::USE_CALLING_UID
};
enum {
- USE_CALLING_PID = ICameraService::USE_CALLING_PID
+ USE_CALLING_PID = ::android::hardware::ICameraService::USE_CALLING_PID
};
// construct a camera client from an existing remote
- static sp<Camera> create(const sp<ICamera>& camera);
+ static sp<Camera> create(const sp<::android::hardware::ICamera>& camera);
static sp<Camera> connect(int cameraId,
const String16& clientPackageName,
int clientUid, int clientPid);