diff options
author | Shuzhen Wang <shuzhenwang@google.com> | 2020-01-10 13:42:15 -0800 |
---|---|---|
committer | Shuzhen Wang <shuzhenwang@google.com> | 2020-01-23 00:08:42 -0800 |
commit | 4385816acc487864df24f48a97c5c1e772d87313 (patch) | |
tree | 47ebe72a3ae88881555ae75cccf1f65d4dc3017a /camera/CameraBase.cpp | |
parent | 0bc6f60e1f036380bd48d022631e6561b90f210c (diff) |
Camera: Support new provider callback version in camera service
The new provider callback version enables availability callback for
physical camera.
Test: Camera CTS
Bug: 119325027
Change-Id: I22e0b669c3d9891a431e1befc7f1c9f40b826a08
Diffstat (limited to 'camera/CameraBase.cpp')
-rw-r--r-- | camera/CameraBase.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/camera/CameraBase.cpp b/camera/CameraBase.cpp index c53e6c3358..aecb70abad 100644 --- a/camera/CameraBase.cpp +++ b/camera/CameraBase.cpp @@ -60,6 +60,13 @@ status_t CameraStatus::writeToParcel(android::Parcel* parcel) const { if (res != OK) return res; res = parcel->writeInt32(status); + if (res != OK) return res; + + std::vector<String16> unavailablePhysicalIds16; + for (auto& id8 : unavailablePhysicalIds) { + unavailablePhysicalIds16.push_back(String16(id8)); + } + res = parcel->writeString16Vector(unavailablePhysicalIds16); return res; } @@ -70,6 +77,14 @@ status_t CameraStatus::readFromParcel(const android::Parcel* parcel) { cameraId = String8(tempCameraId); res = parcel->readInt32(&status); + if (res != OK) return res; + + std::vector<String16> unavailablePhysicalIds16; + res = parcel->readString16Vector(&unavailablePhysicalIds16); + if (res != OK) return res; + for (auto& id16 : unavailablePhysicalIds16) { + unavailablePhysicalIds.push_back(String8(id16)); + } return res; } |