Merge "Fixed typos and incorrect types"
diff --git a/light/2.0/default/service.cpp b/light/2.0/default/service.cpp
index b3848e9..70ae565 100644
--- a/light/2.0/default/service.cpp
+++ b/light/2.0/default/service.cpp
@@ -23,5 +23,5 @@
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
- return defaultPassthroughServiceImplementation<ILight>("light");
+ return defaultPassthroughServiceImplementation<ILight>();
}
diff --git a/light/2.0/vts/functional/light_hidl_hal_test.cpp b/light/2.0/vts/functional/light_hidl_hal_test.cpp
index 9b9f543..71a8b4e 100644
--- a/light/2.0/vts/functional/light_hidl_hal_test.cpp
+++ b/light/2.0/vts/functional/light_hidl_hal_test.cpp
@@ -34,15 +34,13 @@
using ::android::hardware::Void;
using ::android::sp;
-#define LIGHT_SERVICE_NAME "light"
-
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
class LightHidlTest : public ::testing::Test {
public:
virtual void SetUp() override {
- light = ILight::getService(LIGHT_SERVICE_NAME);
+ light = ILight::getService();
ASSERT_NE(light, nullptr);
LOG(INFO) << "Test is remote " << light->isRemote();
diff --git a/memtrack/1.0/default/Memtrack.cpp b/memtrack/1.0/default/Memtrack.cpp
index 5c1a5c4..fa09c25 100644
--- a/memtrack/1.0/default/Memtrack.cpp
+++ b/memtrack/1.0/default/Memtrack.cpp
@@ -79,7 +79,7 @@
memtrack_module_t *memtrack_module = NULL;
ret = hw_get_module(name, &hw_module);
- if (ret == 0 && hw_module->methods->open > 0)
+ if (ret == 0 && hw_module->methods->open)
{
ret = hw_module->methods->open(hw_module, name,
reinterpret_cast<hw_device_t**>(&memtrack_module));
diff --git a/power/1.0/default/Power.cpp b/power/1.0/default/Power.cpp
index 656a2ae..6233a14 100644
--- a/power/1.0/default/Power.cpp
+++ b/power/1.0/default/Power.cpp
@@ -40,14 +40,14 @@
// Methods from ::android::hardware::power::V1_0::IPower follow.
Return<void> Power::setInteractive(bool interactive) {
- if (mModule->setInteractive > 0)
+ if (mModule->setInteractive)
mModule->setInteractive(mModule, interactive ? 1 : 0);
return Void();
}
Return<void> Power::powerHint(PowerHint hint, int32_t data) {
int32_t param = data;
- if (mModule->powerHint > 0) {
+ if (mModule->powerHint) {
if (data)
mModule->powerHint(mModule, static_cast<power_hint_t>(hint), ¶m);
else
@@ -57,7 +57,7 @@
}
Return<void> Power::setFeature(Feature feature, bool activate) {
- if (mModule->setFeature > 0)
+ if (mModule->setFeature)
mModule->setFeature(mModule, static_cast<feature_t>(feature),
activate ? 1 : 0);
return Void();
@@ -79,7 +79,7 @@
}
number_platform_modes = mModule->get_number_of_platform_modes(mModule);
- if (number_platform_modes > 0)
+ if (number_platform_modes)
{
if (SIZE_MAX / sizeof(size_t) <= number_platform_modes) // overflow
goto done;
@@ -149,7 +149,7 @@
const hw_module_t* hw_module = NULL;
power_module_t *power_module;
ret = hw_get_module(name, &hw_module);
- if (ret == 0 && hw_module->methods->open > 0) {
+ if (ret == 0 && hw_module->methods->open) {
ret = hw_module->methods->open(hw_module, name,
reinterpret_cast<hw_device_t**>(&power_module));
if (ret == 0) {