From 84cbd4357528d1e644f27004b3e361da42b34a8c Mon Sep 17 00:00:00 2001 From: danielml Date: Sat, 3 Jun 2023 22:16:39 +0200 Subject: [PATCH] Revert "sm6150-common: parts: Enable doze_status on screen off" * Manually setting the doze status before entering the low-power mode makes the doze mode not to be set correctly on sweet. * The doze status is automatically set when entering the low-power mode This reverts commit 10f101e14301c9a34cb5c74489b439edb6088aa6. Change-Id: I4dfee2ffb351b9bc426268e437a26f9eaefec319 --- parts/src/org/lineageos/settings/doze/DozeService.java | 6 ------ parts/src/org/lineageos/settings/doze/DozeUtils.java | 9 --------- rootdir/etc/init.target.rc | 2 -- sepolicy/vendor/file_contexts | 1 - 4 files changed, 18 deletions(-) diff --git a/parts/src/org/lineageos/settings/doze/DozeService.java b/parts/src/org/lineageos/settings/doze/DozeService.java index 270eab7..84641e1 100644 --- a/parts/src/org/lineageos/settings/doze/DozeService.java +++ b/parts/src/org/lineageos/settings/doze/DozeService.java @@ -72,9 +72,6 @@ public class DozeService extends Service { private void onDisplayOn() { if (DEBUG) Log.d(TAG, "Display on"); - if (DozeUtils.isAlwaysOnEnabled(this)) { - DozeUtils.setDozeStatus(DozeUtils.DOZE_STATUS_DISABLED); - } if (DozeUtils.isPickUpEnabled(this)) { mPickupSensor.disable(); } @@ -89,9 +86,6 @@ public class DozeService extends Service { private void onDisplayOff() { if (DEBUG) Log.d(TAG, "Display off"); - if (DozeUtils.isAlwaysOnEnabled(this)) { - DozeUtils.setDozeStatus(DozeUtils.DOZE_STATUS_ENABLED); - } if (DozeUtils.isPickUpEnabled(this)) { mPickupSensor.enable(); } diff --git a/parts/src/org/lineageos/settings/doze/DozeUtils.java b/parts/src/org/lineageos/settings/doze/DozeUtils.java index 6dc121b..ff1921a 100644 --- a/parts/src/org/lineageos/settings/doze/DozeUtils.java +++ b/parts/src/org/lineageos/settings/doze/DozeUtils.java @@ -60,11 +60,6 @@ public final class DozeUtils { protected static final String DOZE_MODE_HBM = "1"; protected static final String DOZE_MODE_LBM = "0"; - private static final String DOZE_STATUS_PATH = - "/sys/devices/platform/soc/soc:qcom,dsi-display/doze_status"; - protected static final String DOZE_STATUS_ENABLED = "1"; - protected static final String DOZE_STATUS_DISABLED = "0"; - protected static final String DOZE_BRIGHTNESS_LBM = "0"; protected static final String DOZE_BRIGHTNESS_HBM = "1"; protected static final String DOZE_BRIGHTNESS_AUTO = "2"; @@ -157,10 +152,6 @@ public final class DozeUtils { return FileUtils.writeLine(DOZE_MODE_PATH, value); } - protected static boolean setDozeStatus(String value) { - return FileUtils.writeLine(DOZE_STATUS_PATH, value); - } - protected static boolean isDozeAutoBrightnessEnabled(Context context) { return PreferenceManager.getDefaultSharedPreferences(context) .getString(DOZE_BRIGHTNESS_KEY, DOZE_BRIGHTNESS_LBM) diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 11f728b..0c54afb 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -96,9 +96,7 @@ on boot # Set doze mode permissions chown system system /sys/devices/platform/soc/soc:qcom,dsi-display/doze_mode - chown system system /sys/devices/platform/soc/soc:qcom,dsi-display/doze_status chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display/doze_mode - chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display/doze_status # Set xiaomi touch permissions chown system system /dev/xiaomi-touch diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 7899d78..c6dfd77 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -14,7 +14,6 @@ /sys/devices/platform/soc/soc:qcom,dsi-display/fod_ui u:object_r:vendor_sysfs_fod:s0 /sys/devices/platform/soc/soc:qcom,dsi-display/hbm u:object_r:sysfs_hbm:s0 /sys/devices/platform/soc/soc:qcom,dsi-display/doze_mode u:object_r:sysfs_doze:s0 -/sys/devices/platform/soc/soc:qcom,dsi-display/doze_status u:object_r:sysfs_doze:s0 # Fingerprint /dev/goodix_fp u:object_r:fingerprint_device:s0