Implement out-of-band metadata images.
This saves a lot of HIDL bandwidth, by not including raw image data in
metadata vector.
Bug: b/63702941
Test: VTS
Change-Id: I73d5218095e4af34c58da8dcfc520abd4cb46c26
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index 297dcc1..ab3047d 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -20,6 +20,8 @@
#include <log/log.h>
+#include "resources.h"
+
namespace android {
namespace hardware {
namespace broadcastradio {
@@ -155,6 +157,19 @@
return Void();
}
+Return<void> BroadcastRadio::getImage(int32_t id, getImage_cb _hidl_cb) {
+ ALOGV("%s(%x)", __func__, id);
+
+ if (id == resources::demoPngId) {
+ _hidl_cb(std::vector<uint8_t>(resources::demoPng, std::end(resources::demoPng)));
+ return {};
+ }
+
+ ALOGI("Image %x doesn't exists", id);
+ _hidl_cb({});
+ return Void();
+}
+
} // namespace implementation
} // namespace V1_1
} // namespace broadcastradio