sm6375-common: Import Pixel libperfmgr AIDL Power HAL
Change-Id: Ibec82206ac2b070bdcb88213d98f6cc35109ea4f
This commit is contained in:
parent
e136267d24
commit
c40ef4df34
8 changed files with 737 additions and 0 deletions
40
power-libperfmgr/service.cpp
Normal file
40
power-libperfmgr/service.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.power-service.pixel-libperfmgr"
|
||||
|
||||
#include "Power.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
|
||||
using aidl::android::hardware::power::impl::pixel::Power;
|
||||
|
||||
int main() {
|
||||
LOG(INFO) << "Power HAL AIDL Service for Pixel is starting.";
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
std::shared_ptr<Power> pw = ndk::SharedRefBase::make<Power>();
|
||||
|
||||
const std::string instance = std::string() + Power::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(pw->asBinder().get(), instance.c_str());
|
||||
CHECK(status == STATUS_OK);
|
||||
LOG(INFO) << "Power HAL AIDL Service for Pixel is started.";
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
LOG(ERROR) << "Power HAL AIDL Service for Pixel died.";
|
||||
return EXIT_FAILURE; // should not reach
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue