From 9e90b95e0ceb1382fb982e529d5579646f95961b Mon Sep 17 00:00:00 2001 From: chrisl7 Date: Wed, 21 Jun 2023 22:23:26 -0400 Subject: [PATCH] vendor: alarm: Fix power_off_alarm on offline charging [1] - Qualcomm doesn't enable this by default on some platforms, so some OEMs like Xiaomi and OnePlus add this to fix it. Change-Id: I7c786e090d96d6c5b71eaa4a18222434167a59dc Signed-off-by: chrisl7 --- vendor/alarm/Android.bp | 9 +++++++++ vendor/alarm/init.qcom.alarm.rc | 2 ++ vendor/alarm/qti-alarm.mk | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 vendor/alarm/Android.bp create mode 100644 vendor/alarm/init.qcom.alarm.rc diff --git a/vendor/alarm/Android.bp b/vendor/alarm/Android.bp new file mode 100644 index 00000000..d7b31ed9 --- /dev/null +++ b/vendor/alarm/Android.bp @@ -0,0 +1,9 @@ +soong_namespace { +} + +prebuilt_etc { + name: "init.qcom.alarm.rc", + src: "init.qcom.alarm.rc", + sub_dir: "init", + vendor: true, +} diff --git a/vendor/alarm/init.qcom.alarm.rc b/vendor/alarm/init.qcom.alarm.rc new file mode 100644 index 00000000..1576f0a8 --- /dev/null +++ b/vendor/alarm/init.qcom.alarm.rc @@ -0,0 +1,2 @@ +on charger + start vendor.power_off_alarm diff --git a/vendor/alarm/qti-alarm.mk b/vendor/alarm/qti-alarm.mk index e25b4f78..3d0fb52f 100644 --- a/vendor/alarm/qti-alarm.mk +++ b/vendor/alarm/qti-alarm.mk @@ -4,5 +4,12 @@ # SPDX-License-Identifier: Apache-2.0 # +PRODUCT_SOONG_NAMESPACES += \ + device/qcom/common/vendor/alarm + +# Init script +PRODUCT_PACKAGES += \ + init.qcom.alarm.rc + # Get non-open-source specific aspects. $(call inherit-product-if-exists, vendor/qcom/common/vendor/alarm/alarm-vendor.mk)