lineage_patches_unified/patches/platform_frameworks_base/0039-Use-Samsung-power-HAL.patch
2019-09-03 12:42:00 +00:00

31 lines
1.3 KiB
Diff

From 2699dc1cb20a07e8bccf60b47d556d10289bb3b3 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 14 Aug 2019 08:50:47 +0200
Subject: [PATCH 39/40] Use Samsung power HAL
Samsung likes to have two android.hardware.power@1.0 implementation
side-by-side, one that works, one that doesn't.
Pick the one that works.
---
.../core/jni/com_android_server_power_PowerManagerService.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
index b2d35d4153a..3cac85139c5 100644
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
@@ -84,7 +84,9 @@ static bool checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodNa
// The caller must be holding gPowerHalMutex.
static void connectPowerHalLocked() {
if (gPowerHalExists && gPowerHalV1_0_ == nullptr) {
- gPowerHalV1_0_ = IPowerV1_0::getService();
+ gPowerHalV1_0_ = IPowerV1_0::getService("miscpower");
+ if(gPowerHalV1_0_ == nullptr)
+ gPowerHalV1_0_ = IPowerV1_0::getService();
if (gPowerHalV1_0_ != nullptr) {
ALOGI("Loaded power HAL 1.0 service");
// Try cast to powerHAL V1_1
--
2.17.1