Sync up to v300.l

This commit is contained in:
Andy CrossGate Yan
2021-01-13 14:02:28 +00:00
parent 2347b96190
commit 7d0836656a
15 changed files with 1238 additions and 99 deletions

View File

@@ -1,88 +0,0 @@
From 858d6a97037b0f9eb751038a41d28564e7221222 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 30 Mar 2020 10:07:00 +0000
Subject: [PATCH 19/25] Support Huawei light HAL
For https://github.com/phhusson/treble_experimentations/issues/1204
Change-Id: I719a13eb66a46703b7ff0e00113f9b98b3244996
---
services/core/jni/Android.bp | 1 +
...om_android_server_lights_LightsService.cpp | 30 +++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 24a3c68cae2..472c925f76f 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -170,6 +170,7 @@ cc_defaults {
"vendor.samsung.hardware.miscpower@2.0",
"vendor.samsung.hardware.light@2.0",
"vendor.samsung.hardware.light@3.0",
+ "vendor.huawei.hardware.light@2.0",
],
static_libs: [
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
index 268b59a5801..5e535e3dcbf 100644
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
@@ -26,6 +26,7 @@
#include <vendor/samsung/hardware/light/2.0/types.h>
#include <vendor/samsung/hardware/light/3.0/ISehLight.h>
#include <vendor/samsung/hardware/light/3.0/types.h>
+#include <vendor/huawei/hardware/light/2.0/ILight.h>
#include <android-base/chrono_utils.h>
#include <utils/misc.h>
#include <utils/Log.h>
@@ -48,11 +49,15 @@ using SecType = ::vendor::samsung::hardware::light::V2_0::SecType;
using ISehLight = ::vendor::samsung::hardware::light::V3_0::ISehLight;
using SehType = ::vendor::samsung::hardware::light::V3_0::SehType;
using SehLightState = ::vendor::samsung::hardware::light::V3_0::SehLightState;
+using ILightHw = ::vendor::huawei::hardware::light::V2_0::ILight;
+using LightStateHw = ::android::hardware::light::V2_0::LightState;
static bool sLightSupported = true;
static sp<ISecLight> sSecHal;
static sp<ISehLight> sSehHal;
static bool sSecTried = false;
+static sp<ILightHw> sHwHal;
+static bool sHwTried = false;
static bool validate(jint light, jint flash, jint brightness) {
bool valid = true;
@@ -192,6 +197,31 @@ static void setLight_native(
return;
}
+ if (!sHwTried) {
+ sHwHal = ILightHw::getService();
+ //sHwTried = true;
+ }
+
+ if (sHwHal != nullptr && light == 0) {
+ ALOGE("sHwHal triggered!");
+ int brightness = colorARGB & 0xff;
+ int hwBrightness = brightness << 4;
+ LightState state = constructState(hwBrightness, flashMode, onMS, offMS, brightnessMode);
+ bool got260 = false;
+ sHwHal->HWgetSupportedTypes([&](auto types) {
+ for (const auto& type: types) {
+ if (type == 260) {
+ ALOGE("sHwHal reports 260 as a supported type");
+ got260 = true;
+ }
+ }
+ });
+ if (got260) {
+ sHwHal->HWsetLight(260, state);
+ return;
+ }
+ }
+
Type type = static_cast<Type>(light);
LightState state = constructState(
colorARGB, flashMode, onMS, offMS, brightnessMode);
--
2.17.1

View File

@@ -1,4 +1,4 @@
From aaa019b5f93c3954441456259b30077bdd96d784 Mon Sep 17 00:00:00 2001
From 8bd0f8e1905ed0ecf275d383e816afb480feae30 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 6 Dec 2020 12:20:08 +0100
Subject: [PATCH] Make rounded corners padding overridable with
@@ -6,13 +6,15 @@ Subject: [PATCH] Make rounded corners padding overridable with
Change-Id: Id5d73b06b9a2cb2da95ff31f204c1984555872ff
---
.../src/com/android/systemui/qs/QuickStatusBarHeader.java | 6 +++++-
.../systemui/statusbar/phone/KeyguardStatusBarView.java | 6 +++++-
.../systemui/statusbar/phone/PhoneStatusBarView.java | 6 +++++-
3 files changed, 15 insertions(+), 3 deletions(-)
.../systemui/qs/QuickStatusBarHeader.java | 6 +-
.../phone/KeyguardStatusBarView.java | 6 +-
.../statusbar/phone/PhoneStatusBarView.java | 6 +-
..._server_power_PowerManagerService.cpp.orig | 641 ++++++++++++++++++
4 files changed, 656 insertions(+), 3 deletions(-)
create mode 100644 services/core/jni/com_android_server_power_PowerManagerService.cpp.orig
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index 7533f2ac1db3..94fd996d0858 100644
index 7533f2ac1db..94fd996d085 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -32,6 +32,7 @@ import android.graphics.Rect;
@@ -37,7 +39,7 @@ index 7533f2ac1db3..94fd996d0858 100644
// Update height for a few views, especially due to landscape mode restricting space.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 8a4ea21a11ca..a54269460e50 100644
index 8a4ea21a11c..a54269460e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -25,6 +25,7 @@ import android.content.res.Resources;
@@ -62,18 +64,18 @@ index 8a4ea21a11ca..a54269460e50 100644
private void updateVisibilities() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index 7c41bcd09b57..b0cf69b65f5d 100644
index 1c6c7db6a69..f0e5c7bb3d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
import android.content.Context;
@@ -25,6 +25,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.RemoteException;
+import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.EventLog;
import android.util.Pair;
@@ -287,8 +288,11 @@ public class PhoneStatusBarView extends PanelBar {
@@ -331,8 +332,11 @@ public class PhoneStatusBarView extends PanelBar implements Callbacks {
public void updateResources() {
mCutoutSideNudge = getResources().getDimensionPixelSize(
R.dimen.display_cutout_margin_consumption);
@@ -86,6 +88,653 @@ index 7c41bcd09b57..b0cf69b65f5d 100644
updateStatusBarHeight();
}
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp.orig b/services/core/jni/com_android_server_power_PowerManagerService.cpp.orig
new file mode 100644
index 00000000000..47fdcc9a87b
--- /dev/null
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp.orig
@@ -0,0 +1,641 @@
+/*
+ * Copyright (C) 2010 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 "PowerManagerService-JNI"
+
+//#define LOG_NDEBUG 0
+
+#include <android/hardware/power/1.1/IPower.h>
+#include <android/hardware/power/Boost.h>
+#include <android/hardware/power/IPower.h>
+#include <android/hardware/power/Mode.h>
+#include <android/system/suspend/1.0/ISystemSuspend.h>
+#include <android/system/suspend/ISuspendControlService.h>
+#include <vendor/samsung/hardware/miscpower/2.0/ISehMiscPower.h>
+#include <nativehelper/JNIHelp.h>
+#include <vendor/lineage/power/1.0/ILineagePower.h>
+#include "jni.h"
+
+#include <nativehelper/ScopedUtfChars.h>
+
+#include <limits.h>
+
+#include <android-base/chrono_utils.h>
+#include <android_runtime/AndroidRuntime.h>
+#include <android_runtime/Log.h>
+#include <binder/IServiceManager.h>
+#include <gui/SurfaceComposerClient.h>
+#include <hardware/power.h>
+#include <hardware_legacy/power.h>
+#include <hidl/ServiceManagement.h>
+#include <utils/Timers.h>
+#include <utils/misc.h>
+#include <utils/String8.h>
+#include <utils/Log.h>
+#include <android/keycodes.h>
+
+#include "com_android_server_power_PowerManagerService.h"
+
+using android::hardware::Return;
+using android::hardware::Void;
+using android::hardware::power::Boost;
+using android::hardware::power::Mode;
+using android::hardware::power::V1_0::PowerHint;
+using android::hardware::power::V1_0::Feature;
+using android::String8;
+using android::system::suspend::V1_0::ISystemSuspend;
+using android::system::suspend::V1_0::IWakeLock;
+using android::system::suspend::V1_0::WakeLockType;
+using android::system::suspend::ISuspendControlService;
+using IPowerV1_1 = android::hardware::power::V1_1::IPower;
+using IPowerV1_0 = android::hardware::power::V1_0::IPower;
+using IPowerAidl = android::hardware::power::IPower;
+using ILineagePowerV1_0 = vendor::lineage::power::V1_0::ILineagePower;
+using vendor::lineage::power::V1_0::LineageFeature;
+using ISehMiscPower = vendor::samsung::hardware::miscpower::V2_0::ISehMiscPower;
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+
+static struct {
+ jmethodID userActivityFromNative;
+} gPowerManagerServiceClassInfo;
+
+// ----------------------------------------------------------------------------
+
+static jobject gPowerManagerServiceObj;
+static sp<IPowerV1_0> gPowerHalHidlV1_0_ = nullptr;
+static sp<IPowerV1_1> gPowerHalHidlV1_1_ = nullptr;
+static sp<IPowerAidl> gPowerHalAidl_ = nullptr;
+static sp<ILineagePowerV1_0> gLineagePowerHalV1_0_ = nullptr;
+static sp<ISehMiscPower> gSehMiscPower = nullptr;
+static bool gPowerHalExists = true;
+static std::mutex gPowerHalMutex;
+
+enum class HalVersion {
+ NONE,
+ HIDL_1_0,
+ HIDL_1_1,
+ AIDL,
+};
+
+static nsecs_t gLastEventTime[USER_ACTIVITY_EVENT_LAST + 1];
+
+// Throttling interval for user activity calls.
+static const nsecs_t MIN_TIME_BETWEEN_USERACTIVITIES = 100 * 1000000L; // 100ms
+
+// ----------------------------------------------------------------------------
+
+static bool checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) {
+ if (env->ExceptionCheck()) {
+ ALOGE("An exception was thrown by callback '%s'.", methodName);
+ LOGE_EX(env);
+ env->ExceptionClear();
+ return true;
+ }
+ return false;
+}
+
+// Check validity of current handle to the power HAL service, and connect to it if necessary.
+// The caller must be holding gPowerHalMutex.
+static HalVersion connectPowerHalLocked() {
+ static bool gPowerHalHidlExists = true;
+ static bool gPowerHalAidlExists = true;
+ if (!gPowerHalHidlExists && !gPowerHalAidlExists) {
+ return HalVersion::NONE;
+ }
+ if (gPowerHalAidlExists) {
+ if (!gPowerHalAidl_) {
+ gPowerHalAidl_ = waitForVintfService<IPowerAidl>();
+ }
+ if (gPowerHalAidl_) {
+ ALOGV("Successfully connected to Power HAL AIDL service.");
+ return HalVersion::AIDL;
+ } else {
+ gPowerHalAidlExists = false;
+ }
+ }
+ if (gPowerHalExists && gPowerHalHidlV1_0_ == nullptr) {
+ gSehMiscPower = ISehMiscPower::getService();
+ gPowerHalHidlV1_0_ = IPowerV1_0::getService("miscpower");
+ }
+ if (gPowerHalHidlExists && gPowerHalHidlV1_0_ == nullptr) {
+ gPowerHalHidlV1_0_ = IPowerV1_0::getService();
+ if (gPowerHalHidlV1_0_) {
+ ALOGV("Successfully connected to Power HAL HIDL 1.0 service.");
+ // Try cast to powerHAL HIDL V1_1
+ gPowerHalHidlV1_1_ = IPowerV1_1::castFrom(gPowerHalHidlV1_0_);
+ if (gPowerHalHidlV1_1_) {
+ ALOGV("Successfully connected to Power HAL HIDL 1.1 service.");
+ }
+ } else {
+ ALOGV("Couldn't load power HAL HIDL service");
+ gPowerHalHidlExists = false;
+ return HalVersion::NONE;
+ }
+ }
+ if (gPowerHalHidlV1_1_) {
+ return HalVersion::HIDL_1_1;
+ } else if (gPowerHalHidlV1_0_) {
+ return HalVersion::HIDL_1_0;
+ }
+ return HalVersion::NONE;
+}
+
+// Check validity of current handle to the Lineage power HAL service, and call getService() if necessary.
+// The caller must be holding gPowerHalMutex.
+void connectLineagePowerHalLocked() {
+ static bool gLineagePowerHalExists = true;
+ if (gLineagePowerHalExists && gLineagePowerHalV1_0_ == nullptr) {
+ gLineagePowerHalV1_0_ = ILineagePowerV1_0::getService();
+ if (gLineagePowerHalV1_0_ != nullptr) {
+ ALOGI("Loaded power HAL service");
+ } else {
+ ALOGI("Couldn't load power HAL service");
+ gLineagePowerHalExists = false;
+ }
+ }
+}
+
+sp<ISehMiscPower> getSehMiscPower() {
+ std::lock_guard<std::mutex> lock(gPowerHalMutex);
+ connectPowerHalLocked();
+ return gSehMiscPower;
+}
+
+// Retrieve a copy of PowerHAL HIDL V1_0
+sp<IPowerV1_0> getPowerHalHidlV1_0() {
+ std::lock_guard<std::mutex> lock(gPowerHalMutex);
+ HalVersion halVersion = connectPowerHalLocked();
+ if (halVersion == HalVersion::HIDL_1_0 || halVersion == HalVersion::HIDL_1_1) {
+ return gPowerHalHidlV1_0_;
+ }
+
+ return nullptr;
+}
+
+// Retrieve a copy of PowerHAL HIDL V1_1
+sp<IPowerV1_1> getPowerHalHidlV1_1() {
+ std::lock_guard<std::mutex> lock(gPowerHalMutex);
+ if (connectPowerHalLocked() == HalVersion::HIDL_1_1) {
+ return gPowerHalHidlV1_1_;
+ }
+
+ return nullptr;
+}
+
+// Retrieve a copy of LineagePowerHAL V1_0
+sp<ILineagePowerV1_0> getLineagePowerHalV1_0() {
+ std::lock_guard<std::mutex> lock(gPowerHalMutex);
+ connectLineagePowerHalLocked();
+ return gLineagePowerHalV1_0_;
+}
+
+// Check if a call to a power HAL function failed; if so, log the failure and invalidate the
+// current handle to the power HAL service.
+bool processPowerHalReturn(bool isOk, const char* functionName) {
+ if (!isOk) {
+ ALOGE("%s() failed: power HAL service not available.", functionName);
+ gPowerHalMutex.lock();
+ gPowerHalHidlV1_0_ = nullptr;
+ gPowerHalHidlV1_1_ = nullptr;
+ gPowerHalAidl_ = nullptr;
+ gPowerHalMutex.unlock();
+ }
+ return isOk;
+}
+
+enum class HalSupport {
+ UNKNOWN = 0,
+ ON,
+ OFF,
+};
+
+static void setPowerBoostWithHandle(sp<IPowerAidl> handle, Boost boost, int32_t durationMs) {
+ // Android framework only sends boost upto DISPLAY_UPDATE_IMMINENT.
+ // Need to increase the array size if more boost supported.
+ static std::array<std::atomic<HalSupport>,
+ static_cast<int32_t>(Boost::DISPLAY_UPDATE_IMMINENT) + 1>
+ boostSupportedArray = {HalSupport::UNKNOWN};
+
+ // Quick return if boost is not supported by HAL
+ if (boost > Boost::DISPLAY_UPDATE_IMMINENT ||
+ boostSupportedArray[static_cast<int32_t>(boost)] == HalSupport::OFF) {
+ ALOGV("Skipped setPowerBoost %s because HAL doesn't support it", toString(boost).c_str());
+ return;
+ }
+
+ if (boostSupportedArray[static_cast<int32_t>(boost)] == HalSupport::UNKNOWN) {
+ bool isSupported = false;
+ handle->isBoostSupported(boost, &isSupported);
+ boostSupportedArray[static_cast<int32_t>(boost)] =
+ isSupported ? HalSupport::ON : HalSupport::OFF;
+ if (!isSupported) {
+ ALOGV("Skipped setPowerBoost %s because HAL doesn't support it",
+ toString(boost).c_str());
+ return;
+ }
+ }
+
+ auto ret = handle->setBoost(boost, durationMs);
+ processPowerHalReturn(ret.isOk(), "setPowerBoost");
+}
+
+static void setPowerBoost(Boost boost, int32_t durationMs) {
+ std::unique_lock<std::mutex> lock(gPowerHalMutex);
+ if (connectPowerHalLocked() != HalVersion::AIDL) {
+ ALOGV("Power HAL AIDL not available");
+ return;
+ }
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerBoostWithHandle(handle, boost, durationMs);
+}
+
+static bool setPowerModeWithHandle(sp<IPowerAidl> handle, Mode mode, bool enabled) {
+ // Android framework only sends mode upto DISPLAY_INACTIVE.
+ // Need to increase the array if more mode supported.
+ static std::array<std::atomic<HalSupport>, static_cast<int32_t>(Mode::DISPLAY_INACTIVE) + 1>
+ modeSupportedArray = {HalSupport::UNKNOWN};
+
+ // Quick return if mode is not supported by HAL
+ if (mode > Mode::DISPLAY_INACTIVE ||
+ modeSupportedArray[static_cast<int32_t>(mode)] == HalSupport::OFF) {
+ ALOGV("Skipped setPowerMode %s because HAL doesn't support it", toString(mode).c_str());
+ return false;
+ }
+
+ if (modeSupportedArray[static_cast<int32_t>(mode)] == HalSupport::UNKNOWN) {
+ bool isSupported = false;
+ handle->isModeSupported(mode, &isSupported);
+ modeSupportedArray[static_cast<int32_t>(mode)] =
+ isSupported ? HalSupport::ON : HalSupport::OFF;
+ if (!isSupported) {
+ ALOGV("Skipped setPowerMode %s because HAL doesn't support it", toString(mode).c_str());
+ return false;
+ }
+ }
+
+ auto ret = handle->setMode(mode, enabled);
+ processPowerHalReturn(ret.isOk(), "setPowerMode");
+ return ret.isOk();
+}
+
+static bool setPowerMode(Mode mode, bool enabled) {
+ std::unique_lock<std::mutex> lock(gPowerHalMutex);
+ if (connectPowerHalLocked() != HalVersion::AIDL) {
+ ALOGV("Power HAL AIDL not available");
+ return false;
+ }
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ return setPowerModeWithHandle(handle, mode, enabled);
+}
+
+static void sendPowerHint(PowerHint hintId, uint32_t data) {
+ std::unique_lock<std::mutex> lock(gPowerHalMutex);
+ switch (connectPowerHalLocked()) {
+ case HalVersion::NONE:
+ return;
+ case HalVersion::HIDL_1_0: {
+ sp<IPowerV1_0> handle = gPowerHalHidlV1_0_;
+ lock.unlock();
+ auto ret = handle->powerHint(hintId, data);
+ processPowerHalReturn(ret.isOk(), "powerHint");
+ break;
+ }
+ case HalVersion::HIDL_1_1: {
+ sp<IPowerV1_1> handle = gPowerHalHidlV1_1_;
+ lock.unlock();
+ auto ret = handle->powerHintAsync(hintId, data);
+ processPowerHalReturn(ret.isOk(), "powerHintAsync");
+ break;
+ }
+ case HalVersion::AIDL: {
+ if (hintId == PowerHint::INTERACTION) {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerBoostWithHandle(handle, Boost::INTERACTION, data);
+ break;
+ } else if (hintId == PowerHint::LAUNCH) {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::LAUNCH, static_cast<bool>(data));
+ break;
+ } else if (hintId == PowerHint::LOW_POWER) {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::LOW_POWER, static_cast<bool>(data));
+ break;
+ } else if (hintId == PowerHint::SUSTAINED_PERFORMANCE) {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::SUSTAINED_PERFORMANCE,
+ static_cast<bool>(data));
+ break;
+ } else if (hintId == PowerHint::VR_MODE) {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::VR, static_cast<bool>(data));
+ break;
+ } else {
+ ALOGE("Unsupported power hint: %s.", toString(hintId).c_str());
+ return;
+ }
+ }
+ default: {
+ ALOGE("Unknown power HAL state");
+ return;
+ }
+ }
+ SurfaceComposerClient::notifyPowerHint(static_cast<int32_t>(hintId));
+}
+
+void android_server_PowerManagerService_userActivity(nsecs_t eventTime, int32_t eventType,
+ int32_t keyCode) {
+ if (gPowerManagerServiceObj) {
+ // Throttle calls into user activity by event type.
+ // We're a little conservative about argument checking here in case the caller
+ // passes in bad data which could corrupt system state.
+ if (eventType >= 0 && eventType <= USER_ACTIVITY_EVENT_LAST) {
+ nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
+ if (eventTime > now) {
+ eventTime = now;
+ }
+
+ if (gLastEventTime[eventType] + MIN_TIME_BETWEEN_USERACTIVITIES > eventTime) {
+ return;
+ }
+ gLastEventTime[eventType] = eventTime;
+
+ // Tell the power HAL when user activity occurs.
+ sendPowerHint(PowerHint::INTERACTION, 0);
+ }
+
+ JNIEnv* env = AndroidRuntime::getJNIEnv();
+
+ int flags = 0;
+ if (keyCode == AKEYCODE_VOLUME_UP || keyCode == AKEYCODE_VOLUME_DOWN) {
+ flags |= USER_ACTIVITY_FLAG_NO_BUTTON_LIGHTS;
+ }
+
+ env->CallVoidMethod(gPowerManagerServiceObj,
+ gPowerManagerServiceClassInfo.userActivityFromNative,
+ nanoseconds_to_milliseconds(eventTime), eventType, flags);
+ checkAndClearExceptionFromCallback(env, "userActivityFromNative");
+ }
+}
+
+static sp<ISystemSuspend> gSuspendHal = nullptr;
+static sp<ISuspendControlService> gSuspendControl = nullptr;
+static sp<IWakeLock> gSuspendBlocker = nullptr;
+static std::mutex gSuspendMutex;
+
+// Assume SystemSuspend HAL is always alive.
+// TODO: Force device to restart if SystemSuspend HAL dies.
+sp<ISystemSuspend> getSuspendHal() {
+ static std::once_flag suspendHalFlag;
+ std::call_once(suspendHalFlag, [](){
+ ::android::hardware::details::waitForHwService(ISystemSuspend::descriptor, "default");
+ gSuspendHal = ISystemSuspend::getService();
+ assert(gSuspendHal != nullptr);
+ });
+ return gSuspendHal;
+}
+
+sp<ISuspendControlService> getSuspendControl() {
+ static std::once_flag suspendControlFlag;
+ std::call_once(suspendControlFlag, [](){
+ gSuspendControl = waitForService<ISuspendControlService>(String16("suspend_control"));
+ LOG_ALWAYS_FATAL_IF(gSuspendControl == nullptr);
+ });
+ return gSuspendControl;
+}
+
+void enableAutoSuspend() {
+ static bool enabled = false;
+ if (!enabled) {
+ sp<ISuspendControlService> suspendControl = getSuspendControl();
+ suspendControl->enableAutosuspend(&enabled);
+ }
+
+ {
+ std::lock_guard<std::mutex> lock(gSuspendMutex);
+ if (gSuspendBlocker) {
+ gSuspendBlocker->release();
+ gSuspendBlocker.clear();
+ }
+ }
+}
+
+void disableAutoSuspend() {
+ std::lock_guard<std::mutex> lock(gSuspendMutex);
+ if (!gSuspendBlocker) {
+ sp<ISystemSuspend> suspendHal = getSuspendHal();
+ gSuspendBlocker = suspendHal->acquireWakeLock(WakeLockType::PARTIAL,
+ "PowerManager.SuspendLockout");
+ }
+}
+
+static jint nativeGetFeature(JNIEnv* /* env */, jclass /* clazz */, jint featureId) {
+ int value = -1;
+
+ sp<ILineagePowerV1_0> lineagePowerHalV1_0 = getLineagePowerHalV1_0();
+ if (lineagePowerHalV1_0 != nullptr) {
+ value = lineagePowerHalV1_0->getFeature(static_cast<LineageFeature>(featureId));
+ }
+
+ return static_cast<jint>(value);
+}
+
+// ----------------------------------------------------------------------------
+
+static void nativeInit(JNIEnv* env, jobject obj) {
+ gPowerManagerServiceObj = env->NewGlobalRef(obj);
+
+ gPowerHalMutex.lock();
+ connectPowerHalLocked();
+ gPowerHalMutex.unlock();
+}
+
+static void nativeAcquireSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring nameStr) {
+ ScopedUtfChars name(env, nameStr);
+ acquire_wake_lock(PARTIAL_WAKE_LOCK, name.c_str());
+}
+
+static void nativeReleaseSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring nameStr) {
+ ScopedUtfChars name(env, nameStr);
+ release_wake_lock(name.c_str());
+}
+
+static void nativeSetInteractive(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
+ std::unique_lock<std::mutex> lock(gPowerHalMutex);
+ switch (connectPowerHalLocked()) {
+ case HalVersion::NONE:
+ return;
+ case HalVersion::HIDL_1_0:
+ FALLTHROUGH_INTENDED;
+ case HalVersion::HIDL_1_1: {
+ android::base::Timer t;
+ sp<IPowerV1_0> handle = gPowerHalHidlV1_0_;
+ lock.unlock();
+ auto ret = handle->setInteractive(enable);
+ processPowerHalReturn(ret.isOk(), "setInteractive");
+ if (t.duration() > 20ms) {
+ ALOGD("Excessive delay in setInteractive(%s) while turning screen %s",
+ enable ? "true" : "false", enable ? "on" : "off");
+ }
+ return;
+ }
+ case HalVersion::AIDL: {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::INTERACTIVE, enable);
+ return;
+ }
+ default: {
+ ALOGE("Unknown power HAL state");
+ return;
+ }
+ }
+ sp<ISehMiscPower> sehMiscPower = getSehMiscPower();
+ if(sehMiscPower != nullptr) {
+ android::base::Timer t;
+ Return<void> ret = sehMiscPower->setInteractiveAsync(enable, 0);
+ if(!ret.isOk()) {
+ ALOGE("set interactive async() failed: seh misc setInteractiveAsync");
+ }
+ }
+}
+
+static void nativeSetAutoSuspend(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
+ if (enable) {
+ android::base::Timer t;
+ enableAutoSuspend();
+ if (t.duration() > 100ms) {
+ ALOGD("Excessive delay in autosuspend_enable() while turning screen off");
+ }
+ } else {
+ android::base::Timer t;
+ disableAutoSuspend();
+ if (t.duration() > 100ms) {
+ ALOGD("Excessive delay in autosuspend_disable() while turning screen on");
+ }
+ }
+}
+
+static void nativeSendPowerHint(JNIEnv* /* env */, jclass /* clazz */, jint hintId, jint data) {
+ sendPowerHint(static_cast<PowerHint>(hintId), data);
+}
+
+static void nativeSetPowerBoost(JNIEnv* /* env */, jclass /* clazz */, jint boost,
+ jint durationMs) {
+ setPowerBoost(static_cast<Boost>(boost), durationMs);
+}
+
+static jboolean nativeSetPowerMode(JNIEnv* /* env */, jclass /* clazz */, jint mode,
+ jboolean enabled) {
+ return setPowerMode(static_cast<Mode>(mode), enabled);
+}
+
+static void nativeSetFeature(JNIEnv* /* env */, jclass /* clazz */, jint featureId, jint data) {
+ std::unique_lock<std::mutex> lock(gPowerHalMutex);
+ switch (connectPowerHalLocked()) {
+ case HalVersion::NONE:
+ return;
+ case HalVersion::HIDL_1_0:
+ FALLTHROUGH_INTENDED;
+ case HalVersion::HIDL_1_1: {
+ sp<IPowerV1_0> handle = gPowerHalHidlV1_0_;
+ lock.unlock();
+ auto ret = handle->setFeature(static_cast<Feature>(featureId), static_cast<bool>(data));
+ processPowerHalReturn(ret.isOk(), "setFeature");
+ return;
+ }
+ case HalVersion::AIDL: {
+ sp<IPowerAidl> handle = gPowerHalAidl_;
+ lock.unlock();
+ setPowerModeWithHandle(handle, Mode::DOUBLE_TAP_TO_WAKE, static_cast<bool>(data));
+ return;
+ }
+ default: {
+ ALOGE("Unknown power HAL state");
+ return;
+ }
+ }
+}
+
+static bool nativeForceSuspend(JNIEnv* /* env */, jclass /* clazz */) {
+ bool retval = false;
+ getSuspendControl()->forceSuspend(&retval);
+ return retval;
+}
+
+// ----------------------------------------------------------------------------
+
+static const JNINativeMethod gPowerManagerServiceMethods[] = {
+ /* name, signature, funcPtr */
+ {"nativeInit", "()V", (void*)nativeInit},
+ {"nativeAcquireSuspendBlocker", "(Ljava/lang/String;)V",
+ (void*)nativeAcquireSuspendBlocker},
+ {"nativeForceSuspend", "()Z", (void*)nativeForceSuspend},
+ {"nativeReleaseSuspendBlocker", "(Ljava/lang/String;)V",
+ (void*)nativeReleaseSuspendBlocker},
+ {"nativeSetInteractive", "(Z)V", (void*)nativeSetInteractive},
+ {"nativeSetAutoSuspend", "(Z)V", (void*)nativeSetAutoSuspend},
+ {"nativeSendPowerHint", "(II)V", (void*)nativeSendPowerHint},
+ {"nativeSetPowerBoost", "(II)V", (void*)nativeSetPowerBoost},
+ {"nativeSetPowerMode", "(IZ)Z", (void*)nativeSetPowerMode},
+ {"nativeSetFeature", "(II)V", (void*)nativeSetFeature},
+ {"nativeGetFeature", "(I)I", (void*)nativeGetFeature},
+};
+
+#define FIND_CLASS(var, className) \
+ var = env->FindClass(className); \
+ LOG_FATAL_IF(! (var), "Unable to find class " className);
+
+#define GET_METHOD_ID(var, clazz, methodName, methodDescriptor) \
+ var = env->GetMethodID(clazz, methodName, methodDescriptor); \
+ LOG_FATAL_IF(! (var), "Unable to find method " methodName);
+
+#define GET_FIELD_ID(var, clazz, fieldName, fieldDescriptor) \
+ var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
+ LOG_FATAL_IF(! (var), "Unable to find field " fieldName);
+
+int register_android_server_PowerManagerService(JNIEnv* env) {
+ int res = jniRegisterNativeMethods(env, "com/android/server/power/PowerManagerService",
+ gPowerManagerServiceMethods, NELEM(gPowerManagerServiceMethods));
+ (void) res; // Faked use when LOG_NDEBUG.
+ LOG_FATAL_IF(res < 0, "Unable to register native methods.");
+
+ // Callbacks
+
+ jclass clazz;
+ FIND_CLASS(clazz, "com/android/server/power/PowerManagerService");
+
+ GET_METHOD_ID(gPowerManagerServiceClassInfo.userActivityFromNative, clazz,
+ "userActivityFromNative", "(JII)V");
+
+ // Initialize
+ for (int i = 0; i <= USER_ACTIVITY_EVENT_LAST; i++) {
+ gLastEventTime[i] = LLONG_MIN;
+ }
+ gPowerManagerServiceObj = NULL;
+ return 0;
+}
+
+} /* namespace android */
--
2.25.1

View File

@@ -0,0 +1,26 @@
From 54222334328e1bf9202ca95a941894ce48758c40 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 11 Dec 2020 14:41:09 +0100
Subject: [PATCH 30/35] Remove useless notification about "console" service
being running
---
.../core/java/com/android/server/am/ActivityManagerService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 091c77ecaac..df72122a4c5 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -5563,7 +5563,7 @@ public class ActivityManagerService extends IActivityManager.Stub
}
private void showConsoleNotificationIfActive() {
- if (!SystemProperties.get("init.svc.console").equals("running")) {
+ if (!SystemProperties.get("init.svc.console").equals("running") || true) {
return;
}
String title = mContext
--
2.25.1

View File

@@ -0,0 +1,25 @@
From 9d2d5c8b106404769d8e6c2bebd4a2779fd2f21f Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 13 Dec 2020 01:38:50 +0100
Subject: [PATCH 31/35] [Tethering] Ignore DUN required and always use main APN
---
.../android/networkstack/tethering/TetheringConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java b/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
index e1771a56137..65d17ffa54b 100644
--- a/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
+++ b/packages/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
@@ -132,7 +132,7 @@ public class TetheringConfiguration {
tetherableBluetoothRegexs = getResourceStringArray(
res, R.array.config_tether_bluetooth_regexs);
- isDunRequired = checkDunRequired(ctx);
+ isDunRequired = false;
chooseUpstreamAutomatically = getResourceBoolean(
res, R.bool.config_tether_upstream_automatic, false /** defaultValue */);
--
2.25.1

View File

@@ -0,0 +1,95 @@
From e8f19bb6d060133e461791fc51c243f081fc00d0 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 21:24:12 +0800
Subject: [PATCH 32/35] Revert "Remove unused SystemProperties.set"
This reverts commit debb4616ef67f9ed5054eca51ec58592358ff55f.
* Needed for SPRD IMS
---
.../android/telephony/TelephonyManager.java | 69 +++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 1b197b00069..89147084043 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -7033,6 +7033,75 @@ public class TelephonyManager {
}
}
+ /**
+ * Sets a per-phone telephony property with the value specified.
+ *
+ * @hide
+ */
+ @UnsupportedAppUsage
+ public static void setTelephonyProperty(int phoneId, String property, String value) {
+ String propVal = "";
+ String p[] = null;
+ String prop = SystemProperties.get(property);
+
+ if (value == null) {
+ value = "";
+ }
+ value.replace(',', ' ');
+ if (prop != null) {
+ p = prop.split(",");
+ }
+
+ if (!SubscriptionManager.isValidPhoneId(phoneId)) {
+ Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId +
+ " property=" + property + " value: " + value + " prop=" + prop);
+ return;
+ }
+
+ for (int i = 0; i < phoneId; i++) {
+ String str = "";
+ if ((p != null) && (i < p.length)) {
+ str = p[i];
+ }
+ propVal = propVal + str + ",";
+ }
+
+ propVal = propVal + value;
+ if (p != null) {
+ for (int i = phoneId + 1; i < p.length; i++) {
+ propVal = propVal + "," + p[i];
+ }
+ }
+
+ int propValLen = propVal.length();
+ try {
+ propValLen = propVal.getBytes("utf-8").length;
+ } catch (java.io.UnsupportedEncodingException e) {
+ Rlog.d(TAG, "setTelephonyProperty: utf-8 not supported");
+ }
+ if (propValLen > SystemProperties.PROP_VALUE_MAX) {
+ Rlog.d(TAG, "setTelephonyProperty: property too long phoneId=" + phoneId +
+ " property=" + property + " value: " + value + " propVal=" + propVal);
+ return;
+ }
+
+ SystemProperties.set(property, propVal);
+ }
+
+ /**
+ * Sets a global telephony property with the value specified.
+ *
+ * @hide
+ */
+ public static void setTelephonyProperty(String property, String value) {
+ if (value == null) {
+ value = "";
+ }
+ Rlog.d(TAG, "setTelephonyProperty: success" + " property=" +
+ property + " value: " + value);
+ SystemProperties.set(property, value);
+ }
+
/**
* Inserts or updates a list property. Expands the list if its length is not enough.
*/
--
2.25.1

View File

@@ -0,0 +1,84 @@
From 7268f850f701698f948f37a7d5bfac3cc4dae644 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 13:46:15 +0800
Subject: [PATCH 33/35] TelephonyManager: bring back getNetworkClass()
This partially reverts commit c058cac051ab083dc7fb7ea6aa85699110b2e9bf.
* Needed by Spreadtrum IMS
---
.../android/telephony/TelephonyManager.java | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 89147084043..f470d4595c3 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3135,6 +3135,64 @@ public class TelephonyManager {
}
}
+ /**
+ * Network Class Definitions.
+ * Do not change this order, it is used for sorting during emergency calling in
+ * {@link TelephonyConnectionService#getFirstPhoneForEmergencyCall()}. Any newer technologies
+ * should be added after the current definitions.
+ */
+ /** Unknown network class. {@hide} */
+ public static final int NETWORK_CLASS_UNKNOWN = 0;
+ /** Class of broadly defined "2G" networks. {@hide} */
+ @UnsupportedAppUsage
+ public static final int NETWORK_CLASS_2_G = 1;
+ /** Class of broadly defined "3G" networks. {@hide} */
+ @UnsupportedAppUsage
+ public static final int NETWORK_CLASS_3_G = 2;
+ /** Class of broadly defined "4G" networks. {@hide} */
+ @UnsupportedAppUsage
+ public static final int NETWORK_CLASS_4_G = 3;
+ /** Class of broadly defined "5G" networks. {@hide} */
+ public static final int NETWORK_CLASS_5_G = 4;
+
+ /**
+ * Return general class of network type, such as "3G" or "4G". In cases
+ * where classification is contentious, this method is conservative.
+ *
+ * @hide
+ */
+ @UnsupportedAppUsage
+ public static int getNetworkClass(int networkType) {
+ switch (networkType) {
+ case NETWORK_TYPE_GPRS:
+ case NETWORK_TYPE_GSM:
+ case NETWORK_TYPE_EDGE:
+ case NETWORK_TYPE_CDMA:
+ case NETWORK_TYPE_1xRTT:
+ case NETWORK_TYPE_IDEN:
+ return NETWORK_CLASS_2_G;
+ case NETWORK_TYPE_UMTS:
+ case NETWORK_TYPE_EVDO_0:
+ case NETWORK_TYPE_EVDO_A:
+ case NETWORK_TYPE_HSDPA:
+ case NETWORK_TYPE_HSUPA:
+ case NETWORK_TYPE_HSPA:
+ case NETWORK_TYPE_EVDO_B:
+ case NETWORK_TYPE_EHRPD:
+ case NETWORK_TYPE_HSPAP:
+ case NETWORK_TYPE_TD_SCDMA:
+ return NETWORK_CLASS_3_G;
+ case NETWORK_TYPE_LTE:
+ case NETWORK_TYPE_IWLAN:
+ case NETWORK_TYPE_LTE_CA:
+ return NETWORK_CLASS_4_G;
+ case NETWORK_TYPE_NR:
+ return NETWORK_CLASS_5_G;
+ default:
+ return NETWORK_CLASS_UNKNOWN;
+ }
+ }
+
/**
* Returns a string representation of the radio technology (network type)
* currently in use on the device.
--
2.25.1

View File

@@ -0,0 +1,41 @@
From 04a8e10d1ac42ade9e707081920940931bc80f07 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 16 Dec 2020 21:26:45 +0800
Subject: [PATCH 34/35] TelephonyManager: add API annotations for
setTelephonyProperty
* This method was added back by reverting commit
debb4616ef67f9ed5054eca51ec58592358ff55f, but they do not conform to
the new R API requirements.
* R requires such annotations.
---
telephony/java/android/telephony/TelephonyManager.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index f470d4595c3..4b912e88798 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -7097,7 +7097,7 @@ public class TelephonyManager {
* @hide
*/
@UnsupportedAppUsage
- public static void setTelephonyProperty(int phoneId, String property, String value) {
+ public static void setTelephonyProperty(int phoneId, @NonNull String property, @Nullable String value) {
String propVal = "";
String p[] = null;
String prop = SystemProperties.get(property);
@@ -7151,7 +7151,8 @@ public class TelephonyManager {
*
* @hide
*/
- public static void setTelephonyProperty(String property, String value) {
+ @UnsupportedAppUsage
+ public static void setTelephonyProperty(@NonNull String property, @Nullable String value) {
if (value == null) {
value = "";
}
--
2.25.1

View File

@@ -0,0 +1,72 @@
From 792b863af87a7bd3d063da76ecefa7e229e1aded Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 18 Dec 2020 16:38:58 -0500
Subject: [PATCH] Fix Samsung Power HAL (switch/case was filled with
mines/returns), and cleanup code and add logs
---
...droid_server_power_PowerManagerService.cpp | 25 +++++++++++--------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
index 47fdcc9a87b..ed7d311ab9f 100644
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
@@ -83,7 +83,6 @@ static sp<IPowerV1_1> gPowerHalHidlV1_1_ = nullptr;
static sp<IPowerAidl> gPowerHalAidl_ = nullptr;
static sp<ILineagePowerV1_0> gLineagePowerHalV1_0_ = nullptr;
static sp<ISehMiscPower> gSehMiscPower = nullptr;
-static bool gPowerHalExists = true;
static std::mutex gPowerHalMutex;
enum class HalVersion {
@@ -129,9 +128,11 @@ static HalVersion connectPowerHalLocked() {
gPowerHalAidlExists = false;
}
}
- if (gPowerHalExists && gPowerHalHidlV1_0_ == nullptr) {
+ if (gPowerHalHidlExists && gPowerHalHidlV1_0_ == nullptr) {
+ ALOGE("Trying to connect to Samsung Power HAL");
gSehMiscPower = ISehMiscPower::getService();
gPowerHalHidlV1_0_ = IPowerV1_0::getService("miscpower");
+ ALOGE("Got miscpower = %d, SehMiscPower = %d", gPowerHalHidlV1_0_ != nullptr ? 1 : 0, gSehMiscPower ? 1 : 0);
}
if (gPowerHalHidlExists && gPowerHalHidlV1_0_ == nullptr) {
gPowerHalHidlV1_0_ = IPowerV1_0::getService();
@@ -484,7 +485,17 @@ static void nativeReleaseSuspendBlocker(JNIEnv *env, jclass /* clazz */, jstring
static void nativeSetInteractive(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
std::unique_lock<std::mutex> lock(gPowerHalMutex);
- switch (connectPowerHalLocked()) {
+
+ auto powerHalType = connectPowerHalLocked();
+ if(gSehMiscPower != nullptr) {
+ android::base::Timer t;
+ Return<void> ret = gSehMiscPower->setInteractiveAsync(enable, 0);
+ if(!ret.isOk()) {
+ ALOGE("set interactive async() failed: seh misc setInteractiveAsync");
+ }
+ }
+
+ switch (powerHalType) {
case HalVersion::NONE:
return;
case HalVersion::HIDL_1_0:
@@ -512,14 +523,6 @@ static void nativeSetInteractive(JNIEnv* /* env */, jclass /* clazz */, jboolean
return;
}
}
- sp<ISehMiscPower> sehMiscPower = getSehMiscPower();
- if(sehMiscPower != nullptr) {
- android::base::Timer t;
- Return<void> ret = sehMiscPower->setInteractiveAsync(enable, 0);
- if(!ret.isOk()) {
- ALOGE("set interactive async() failed: seh misc setInteractiveAsync");
- }
- }
}
static void nativeSetAutoSuspend(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
--
2.25.1