Extend PowerHalWrapper to support HIDL 1.2 and 1.3
* Added support for 1.2 and 1.3 HIDL calls to the PowerHalWrapper
* Expanded the wrapper and loader tests to cover these new versions
* Lightly tweaked the existing tests to make them more comprehensive
Bug: b/244631171
Test: atest libpowermanager_test
Change-Id: I5890106817b7cf243cdd21b3acf22ff7fcd8174e
diff --git a/include/powermanager/PowerHalLoader.h b/include/powermanager/PowerHalLoader.h
index ed6f6f3..e0384f3 100644
--- a/include/powermanager/PowerHalLoader.h
+++ b/include/powermanager/PowerHalLoader.h
@@ -19,6 +19,8 @@
#include <android-base/thread_annotations.h>
#include <android/hardware/power/1.1/IPower.h>
+#include <android/hardware/power/1.2/IPower.h>
+#include <android/hardware/power/1.3/IPower.h>
#include <android/hardware/power/IPower.h>
namespace android {
@@ -32,12 +34,16 @@
static sp<hardware::power::IPower> loadAidl();
static sp<hardware::power::V1_0::IPower> loadHidlV1_0();
static sp<hardware::power::V1_1::IPower> loadHidlV1_1();
+ static sp<hardware::power::V1_2::IPower> loadHidlV1_2();
+ static sp<hardware::power::V1_3::IPower> loadHidlV1_3();
private:
static std::mutex gHalMutex;
static sp<hardware::power::IPower> gHalAidl GUARDED_BY(gHalMutex);
static sp<hardware::power::V1_0::IPower> gHalHidlV1_0 GUARDED_BY(gHalMutex);
static sp<hardware::power::V1_1::IPower> gHalHidlV1_1 GUARDED_BY(gHalMutex);
+ static sp<hardware::power::V1_2::IPower> gHalHidlV1_2 GUARDED_BY(gHalMutex);
+ static sp<hardware::power::V1_3::IPower> gHalHidlV1_3 GUARDED_BY(gHalMutex);
static sp<hardware::power::V1_0::IPower> loadHidlV1_0Locked()
EXCLUSIVE_LOCKS_REQUIRED(gHalMutex);