mirror of
https://github.com/PixelExperience-Devices/device_xiaomi_sm6250-common.git
synced 2025-05-21 21:07:16 +09:00
Revert "sm6250-common: power: add no-op 1.3 interface implementation"
This reverts commit 40eda54cb1b688efd1bc89ab29a6edc021428eed. Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com> Conflicts: sepolicy/vendor/file_contexts
This commit is contained in:
parent
db8339d7a2
commit
4f99554617
@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (C) 2018 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.
|
|
||||||
|
|
||||||
cc_binary {
|
|
||||||
name: "android.hardware.power@1.3-service.xiaomi_sm6250",
|
|
||||||
init_rc: ["android.hardware.power@1.3-service.xiaomi_sm6250.rc"],
|
|
||||||
relative_install_path: "hw",
|
|
||||||
proprietary: true,
|
|
||||||
srcs: [
|
|
||||||
"Power.cpp",
|
|
||||||
"service.cpp",
|
|
||||||
],
|
|
||||||
shared_libs: [
|
|
||||||
"liblog",
|
|
||||||
"libhidlbase",
|
|
||||||
"libhidltransport",
|
|
||||||
"libutils",
|
|
||||||
"android.hardware.power@1.3",
|
|
||||||
"android.hardware.power@1.2",
|
|
||||||
"android.hardware.power@1.1",
|
|
||||||
"android.hardware.power@1.0",
|
|
||||||
],
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020 The LineageOS 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@1.3-service.xiaomi_sm6250"
|
|
||||||
|
|
||||||
#include "Power.h"
|
|
||||||
|
|
||||||
namespace android {
|
|
||||||
namespace hardware {
|
|
||||||
namespace power {
|
|
||||||
namespace V1_3 {
|
|
||||||
namespace implementation {
|
|
||||||
|
|
||||||
// Methods from V1_0::IPower follow.
|
|
||||||
Return<void> Power::setInteractive(bool) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<void> Power::powerHint(PowerHint_1_0, int32_t) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<void> Power::setFeature(Feature, bool) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<void> Power::getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) {
|
|
||||||
ALOGI("getPlatformLowPowerStats not supported, do nothing");
|
|
||||||
_hidl_cb({}, Status::SUCCESS);
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods from V1_1::IPower follow.
|
|
||||||
Return<void> Power::getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) {
|
|
||||||
ALOGI("getSubsystemLowPowerStats not supported, do nothing");
|
|
||||||
_hidl_cb({}, Status::SUCCESS);
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
Return<void> Power::powerHintAsync(PowerHint_1_0, int32_t) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods from V1_2::IPower follow.
|
|
||||||
Return<void> Power::powerHintAsync_1_2(PowerHint_1_2, int32_t) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods from V1_3::IPower follow.
|
|
||||||
Return<void> Power::powerHintAsync_1_3(PowerHint_1_3, int32_t) {
|
|
||||||
return Void();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace implementation
|
|
||||||
} // namespace V1_3
|
|
||||||
} // namespace power
|
|
||||||
} // namespace hardware
|
|
||||||
} // namespace android
|
|
@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020 The LineageOS 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <android/hardware/power/1.3/IPower.h>
|
|
||||||
#include <hidl/Status.h>
|
|
||||||
#include <utils/Log.h>
|
|
||||||
|
|
||||||
namespace android {
|
|
||||||
namespace hardware {
|
|
||||||
namespace power {
|
|
||||||
namespace V1_3 {
|
|
||||||
namespace implementation {
|
|
||||||
|
|
||||||
using ::android::hardware::Return;
|
|
||||||
using ::android::hardware::Void;
|
|
||||||
|
|
||||||
using ::android::hardware::power::V1_0::Feature;
|
|
||||||
using ::android::hardware::power::V1_0::Status;
|
|
||||||
using PowerHint_1_0 = ::android::hardware::power::V1_0::PowerHint;
|
|
||||||
using PowerHint_1_2 = ::android::hardware::power::V1_2::PowerHint;
|
|
||||||
using PowerHint_1_3 = ::android::hardware::power::V1_3::PowerHint;
|
|
||||||
|
|
||||||
struct Power : public IPower {
|
|
||||||
// Methods from V1_0::IPower follow.
|
|
||||||
Return<void> setInteractive(bool interactive) override;
|
|
||||||
Return<void> powerHint(PowerHint_1_0 hint, int32_t data) override;
|
|
||||||
Return<void> setFeature(V1_0::Feature feature, bool activate) override;
|
|
||||||
Return<void> getPlatformLowPowerStats(getPlatformLowPowerStats_cb _hidl_cb) override;
|
|
||||||
|
|
||||||
// Methods from V1_1::IPower follow.
|
|
||||||
Return<void> getSubsystemLowPowerStats(getSubsystemLowPowerStats_cb _hidl_cb) override;
|
|
||||||
Return<void> powerHintAsync(PowerHint_1_0 hint, int32_t data) override;
|
|
||||||
|
|
||||||
// Methods from V1_2::IPower follow.
|
|
||||||
Return<void> powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) override;
|
|
||||||
|
|
||||||
// Methods from V1_3::IPower follow.
|
|
||||||
Return<void> powerHintAsync_1_3(PowerHint_1_3 hint, int32_t data) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace implementation
|
|
||||||
} // namespace V1_3
|
|
||||||
} // namespace power
|
|
||||||
} // namespace hardware
|
|
||||||
} // namespace android
|
|
@ -1,4 +0,0 @@
|
|||||||
service vendor.power-hal-1-0 /vendor/bin/hw/android.hardware.power@1.3-service.xiaomi_sm6250
|
|
||||||
class hal
|
|
||||||
user system
|
|
||||||
group system
|
|
@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020 The LineageOS 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@1.3-service.xiaomi_sm6250"
|
|
||||||
|
|
||||||
#include <hidl/HidlTransportSupport.h>
|
|
||||||
|
|
||||||
#include "Power.h"
|
|
||||||
|
|
||||||
using android::sp;
|
|
||||||
using android::status_t;
|
|
||||||
using android::OK;
|
|
||||||
|
|
||||||
using android::hardware::configureRpcThreadpool;
|
|
||||||
using android::hardware::joinRpcThreadpool;
|
|
||||||
|
|
||||||
using ::android::hardware::power::V1_3::IPower;
|
|
||||||
using ::android::hardware::power::V1_3::implementation::Power;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
ALOGI("Power HAL 1.3 service is starting");
|
|
||||||
|
|
||||||
sp<IPower> service = new Power();
|
|
||||||
if (service == nullptr) {
|
|
||||||
ALOGE("Failed to create an instance of Power HAL, exiting");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
configureRpcThreadpool(1, true /* callerWillJoin */);
|
|
||||||
|
|
||||||
status_t status = service->registerAsService();
|
|
||||||
if (status != OK) {
|
|
||||||
ALOGE("Failed to register service for Power HAL, exiting");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ALOGI("Power HAL service is ready");
|
|
||||||
joinRpcThreadpool();
|
|
||||||
|
|
||||||
// In normal operation, we don't expect the thread pool to exit
|
|
||||||
ALOGE("Power HAL service is shutting down");
|
|
||||||
return 1;
|
|
||||||
}
|
|
3
sepolicy/vendor/file_contexts
vendored
3
sepolicy/vendor/file_contexts
vendored
@ -2,6 +2,3 @@
|
|||||||
/vendor/bin/batteryd u:object_r:batteryd_exec:s0
|
/vendor/bin/batteryd u:object_r:batteryd_exec:s0
|
||||||
/vendor/bin/batterysecret u:object_r:batterysecret_exec:s0
|
/vendor/bin/batterysecret u:object_r:batterysecret_exec:s0
|
||||||
/mnt/vendor/persist/subsys(/.*)? u:object_r:persist_subsys_file:s0
|
/mnt/vendor/persist/subsys(/.*)? u:object_r:persist_subsys_file:s0
|
||||||
|
|
||||||
# Power HAL
|
|
||||||
/vendor/bin/hw/android\.hardware\.power@1\.3-service\.xiaomi_sm6250 u:object_r:hal_power_default_exec:s0
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user