summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wei Wang <wvw@google.com> 2018-10-27 20:54:21 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-10-27 20:54:21 +0000
commit36607ad09fc13e25ea80560cfda233b1801d353e (patch)
tree3037db01135bc5a238863035ca6eaa0c38c6c6ec
parent9d859ebfe45081735af72b1372ac36b97a103e4c (diff)
parent01065acda7d0b58498e1cbd4cc8ec0c23740e087 (diff)
Merge "Rename callback to reflect HAL version"
-rw-r--r--services/thermalservice/thermalserviced.cpp24
-rw-r--r--services/thermalservice/thermalserviced.h4
2 files changed, 14 insertions, 14 deletions
diff --git a/services/thermalservice/thermalserviced.cpp b/services/thermalservice/thermalserviced.cpp
index 7826a7606f..0bfaaffbfc 100644
--- a/services/thermalservice/thermalserviced.cpp
+++ b/services/thermalservice/thermalserviced.cpp
@@ -73,10 +73,10 @@ void ThermalServiceDaemon::thermalServiceStartup() {
mThermalService = new android::os::ThermalService;
mThermalService->publish(mThermalService);
// Register IThermalService object to ThermalHAL callback
- if (mThermalChangedCallback != nullptr) {
- mThermalChangedCallback->registerThermalService(mThermalService);
- } else if (mThermalCallback != nullptr) {
- mThermalCallback->registerThermalService(mThermalService);
+ if (mThermalCallback_2_0 != nullptr) {
+ mThermalCallback_2_0->registerThermalService(mThermalService);
+ } else if (mThermalCallback_1_1 != nullptr) {
+ mThermalCallback_1_1->registerThermalService(mThermalService);
}
IPCThreadState::self()->joinThreadPool();
}
@@ -103,8 +103,8 @@ void ThermalServiceDaemon::getThermalHal() {
gThermalHal1_1->linkToDeath(gThermalHalDied, 0x451F /* cookie */);
}
- if (mThermalCallback != nullptr) {
- Return<void> ret = gThermalHal1_1->registerThermalCallback(mThermalCallback);
+ if (mThermalCallback_1_1 != nullptr) {
+ Return<void> ret = gThermalHal1_1->registerThermalCallback(mThermalCallback_1_1);
if (!ret.isOk()) {
SLOGE("registerThermalCallback failed, status: %s", ret.description().c_str());
}
@@ -114,10 +114,10 @@ void ThermalServiceDaemon::getThermalHal() {
gThermalHal2_0->linkToDeath(gThermalHalDied, 0x451F /* cookie */);
}
- if (mThermalCallback != nullptr) {
+ if (mThermalCallback_2_0 != nullptr) {
Return<void> ret =
gThermalHal2_0
- ->registerThermalChangedCallback(mThermalChangedCallback, false,
+ ->registerThermalChangedCallback(mThermalCallback_2_0, false,
TemperatureType::SKIN, // not used
[](ThermalStatus status) {
if (ThermalStatusCode::SUCCESS !=
@@ -138,11 +138,11 @@ void ThermalServiceDaemon::getThermalHal() {
}
ThermalServiceDaemon::~ThermalServiceDaemon() {
- if (mThermalCallback != nullptr && gThermalHal2_0 != nullptr) {
+ if (mThermalCallback_2_0 != nullptr && gThermalHal2_0 != nullptr) {
Return<void> ret =
gThermalHal2_0
->unregisterThermalChangedCallback(
- mThermalChangedCallback,
+ mThermalCallback_2_0,
[](ThermalStatus status) {
if (ThermalStatusCode::SUCCESS !=
status.code) {
@@ -163,8 +163,8 @@ void ThermalServiceDaemon::thermalCallbackStartup() {
// to come back on the binder death notification thread and we need
// another thread for the incoming service now available call.
configureRpcThreadpool(2, false /* callerWillJoin */);
- mThermalCallback = new ThermalCallback();
- mThermalChangedCallback = new ThermalChangedCallback();
+ mThermalCallback_1_1 = new ThermalCallback();
+ mThermalCallback_2_0 = new ThermalChangedCallback();
// Lookup Thermal HAL 1.1 and 2.0 to register our Callback.
getThermalHal();
}
diff --git a/services/thermalservice/thermalserviced.h b/services/thermalservice/thermalserviced.h
index c6575f3eed..ff7a483071 100644
--- a/services/thermalservice/thermalserviced.h
+++ b/services/thermalservice/thermalserviced.h
@@ -37,8 +37,8 @@ class ThermalServiceDaemon {
private:
sp<ThermalService> mThermalService;
- sp<ThermalCallback> mThermalCallback;
- sp<ThermalChangedCallback> mThermalChangedCallback;
+ sp<ThermalCallback> mThermalCallback_1_1;
+ sp<ThermalChangedCallback> mThermalCallback_2_0;
};
#endif // ANDROID_THERMALSERVICE_THERMALSERVICED_H