configstore: configstore HAL uprev'ed to 1.1
This change provides a reference implementation of the configstore HAL
v1.1.
Bug: 69691076
Test: tested on walleye-userdebug
Change-Id: I68ee224bcbda64f6fef91e8a0f95adb32d504aad
diff --git a/configstore/utils/Android.bp b/configstore/utils/Android.bp
index 93e52f1..cb4e6eb 100644
--- a/configstore/utils/Android.bp
+++ b/configstore/utils/Android.bp
@@ -28,11 +28,13 @@
shared_libs: [
"android.hardware.configstore@1.0",
+ "android.hardware.configstore@1.1",
"libbase",
"libhidlbase"
],
export_shared_lib_headers: [
"android.hardware.configstore@1.0",
+ "android.hardware.configstore@1.1",
"libbase",
"libhidlbase"
],
diff --git a/configstore/utils/include/configstore/Utils.h b/configstore/utils/include/configstore/Utils.h
index b107a20..e04f57d 100644
--- a/configstore/utils/include/configstore/Utils.h
+++ b/configstore/utils/include/configstore/Utils.h
@@ -18,6 +18,7 @@
#define ANDROID_HARDWARE_CONFIGSTORE_UTILS_H
#include <android/hardware/configstore/1.0/types.h>
+#include <android/hardware/configstore/1.1/types.h>
#include <hidl/Status.h>
#include <sstream>
@@ -34,13 +35,20 @@
} // namespace details
namespace configstore {
-// import types from V1_0
+// import types from configstore
+using ::android::hardware::configstore::V1_1::DisplayOrientation;
using ::android::hardware::configstore::V1_0::OptionalBool;
using ::android::hardware::configstore::V1_0::OptionalInt32;
using ::android::hardware::configstore::V1_0::OptionalUInt32;
using ::android::hardware::configstore::V1_0::OptionalInt64;
using ::android::hardware::configstore::V1_0::OptionalUInt64;
using ::android::hardware::configstore::V1_0::OptionalString;
+using ::android::hardware::configstore::V1_1::OptionalDisplayOrientation;
+
+static inline std::ostream& operator<<(std::ostream& os, DisplayOrientation orientation) {
+ os << ::android::hardware::configstore::V1_1::toString(orientation);
+ return os;
+}
// a function to retrieve and cache the service handle
// for a particular interface
@@ -141,6 +149,12 @@
return get<OptionalString, I, func>(defValue);
}
+template <typename I, android::hardware::Return<void> (I::*func)(
+ std::function<void(const OptionalDisplayOrientation&)>)>
+DisplayOrientation getDisplayOrientation(DisplayOrientation defValue) {
+ return get<OptionalDisplayOrientation, I, func>(defValue);
+}
+
} // namespace configstore
} // namespace hardware
} // namespace android