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/CameraMetadata.h b/include/camera/CameraMetadata.h
index 953d711..db400de 100644
--- a/include/camera/CameraMetadata.h
+++ b/include/camera/CameraMetadata.h
@@ -20,14 +20,14 @@
#include "system/camera_metadata.h"
#include <utils/String8.h>
#include <utils/Vector.h>
+#include <binder/Parcelable.h>
namespace android {
-class Parcel;
/**
* A convenience wrapper around the C-based camera_metadata_t library.
*/
-class CameraMetadata {
+class CameraMetadata: public Parcelable {
public:
/** Creates an empty object; best used when expecting to acquire contents
* from elsewhere */
@@ -186,8 +186,8 @@
*/
// Metadata object is unchanged when reading from parcel fails.
- status_t readFromParcel(Parcel *parcel);
- status_t writeToParcel(Parcel *parcel) const;
+ virtual status_t readFromParcel(const Parcel *parcel) override;
+ virtual status_t writeToParcel(Parcel *parcel) const override;
/**
* Caller becomes the owner of the new metadata
@@ -227,6 +227,15 @@
};
-}; // namespace android
+namespace hardware {
+namespace camera2 {
+namespace impl {
+using ::android::CameraMetadata;
+typedef CameraMetadata CameraMetadataNative;
+}
+}
+}
+
+} // namespace android
#endif