|
|
@ -19,7 +19,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "Thermal.h" |
|
|
|
#include "Thermal.h" |
|
|
|
|
|
|
|
|
|
|
|
constexpr std::string_view kThermalLogTag("pixel-thermal"); |
|
|
|
constexpr std::string_view kThermalLogTag("samsung-thermal"); |
|
|
|
|
|
|
|
|
|
|
|
using ::android::OK; |
|
|
|
using ::android::OK; |
|
|
|
using ::android::status_t; |
|
|
|
using ::android::status_t; |
|
|
@ -36,16 +36,16 @@ int main(int /* argc */, char ** /* argv */) { |
|
|
|
|
|
|
|
|
|
|
|
auto svc = ndk::SharedRefBase::make<Thermal>(); |
|
|
|
auto svc = ndk::SharedRefBase::make<Thermal>(); |
|
|
|
const auto svcName = std::string() + svc->descriptor + "/" + THERMAL_INSTANCE_NAME; |
|
|
|
const auto svcName = std::string() + svc->descriptor + "/" + THERMAL_INSTANCE_NAME; |
|
|
|
LOG(INFO) << "Pixel Thermal AIDL Service starting..." + svcName; |
|
|
|
LOG(INFO) << "Samsung Thermal AIDL Service starting..." + svcName; |
|
|
|
ABinderProcess_setThreadPoolMaxThreadCount(0); |
|
|
|
ABinderProcess_setThreadPoolMaxThreadCount(0); |
|
|
|
|
|
|
|
|
|
|
|
auto svcBinder = svc->asBinder(); |
|
|
|
auto svcBinder = svc->asBinder(); |
|
|
|
binder_status_t status = AServiceManager_addService(svcBinder.get(), svcName.c_str()); |
|
|
|
binder_status_t status = AServiceManager_addService(svcBinder.get(), svcName.c_str()); |
|
|
|
if (status != STATUS_OK) { |
|
|
|
if (status != STATUS_OK) { |
|
|
|
LOG(ERROR) << "Pixel Thermal AIDL Service failed to start: " << status << "."; |
|
|
|
LOG(ERROR) << "Samsung Thermal AIDL Service failed to start: " << status << "."; |
|
|
|
return EXIT_FAILURE; |
|
|
|
return EXIT_FAILURE; |
|
|
|
} |
|
|
|
} |
|
|
|
LOG(INFO) << "Pixel Thermal HAL AIDL Service started."; |
|
|
|
LOG(INFO) << "Samsung Thermal HAL AIDL Service started."; |
|
|
|
ABinderProcess_joinThreadPool(); |
|
|
|
ABinderProcess_joinThreadPool(); |
|
|
|
return EXIT_FAILURE; // should not reach
|
|
|
|
return EXIT_FAILURE; // should not reach
|
|
|
|
} |
|
|
|
} |
|
|
|