diff --git a/DeviceSettings/res/values-de-rDE/strings.xml b/DeviceSettings/res/values-de-rDE/strings.xml
index ba05baf6..f6ad7817 100644
--- a/DeviceSettings/res/values-de-rDE/strings.xml
+++ b/DeviceSettings/res/values-de-rDE/strings.xml
@@ -60,6 +60,4 @@
Wert zwischen %1d und %2d
Inaktivitätsdisplay
Graustufen-Modus
- Aktiviere Aufwecken mit Flip Cover
- Schalte das Gerät AN und AUS mit einem magnetischen Flip Cover
diff --git a/DeviceSettings/res/values-es-rES/strings.xml b/DeviceSettings/res/values-es-rES/strings.xml
index 609fc03a..1526976d 100644
--- a/DeviceSettings/res/values-es-rES/strings.xml
+++ b/DeviceSettings/res/values-es-rES/strings.xml
@@ -77,10 +77,6 @@
Amoled Extremo
Amoled caliente
Mamba híbrido
-
- Despertar con funda flip
- Activar levantamiento con funda flip
- Despertar dispositivo con una funda flip magnética
Valor por defecto
diff --git a/DeviceSettings/res/values-in-rID/strings.xml b/DeviceSettings/res/values-in-rID/strings.xml
index 022c75fc..6be2360f 100644
--- a/DeviceSettings/res/values-in-rID/strings.xml
+++ b/DeviceSettings/res/values-in-rID/strings.xml
@@ -82,9 +82,6 @@
Amoled hangat
Hibrid
- Flip cover nyala
- Aktifkan Flip Cover nyala
- Nyalakan perangkat saat flip cover magnetik dibuka
@string/presets_dialog_title
Reset
diff --git a/DeviceSettings/res/values-ja-rJP/strings.xml b/DeviceSettings/res/values-ja-rJP/strings.xml
index 721a9f37..4581ef8f 100644
--- a/DeviceSettings/res/values-ja-rJP/strings.xml
+++ b/DeviceSettings/res/values-ja-rJP/strings.xml
@@ -74,8 +74,6 @@
暖色 AMOLED
Hybrid Mamba
-
-
@string/presets_dialog_title
リセット
@@ -84,9 +82,5 @@
新しい値を選択して下さい
既定値
値は %1$d と %2$d の間です
-
-
- フリップカバーの復帰
- フリップカバーの復帰の有効化
- マグネットフリップカバーでスリープ解除する
+
diff --git a/DeviceSettings/res/values-pt-rBR/strings.xml b/DeviceSettings/res/values-pt-rBR/strings.xml
index af141212..02291a33 100644
--- a/DeviceSettings/res/values-pt-rBR/strings.xml
+++ b/DeviceSettings/res/values-pt-rBR/strings.xml
@@ -82,9 +82,6 @@
Amoled Quente
Mamba Híbrida
- Flip Cover
- Ativar a tela com Flip Cover
- Ativa a tela ao usar uma Flip Cover magnética
@string/presets_dialog_title
Redefinir
diff --git a/DeviceSettings/res/values-ru-rRU/strings.xml b/DeviceSettings/res/values-ru-rRU/strings.xml
index 231aa814..afffdfd2 100644
--- a/DeviceSettings/res/values-ru-rRU/strings.xml
+++ b/DeviceSettings/res/values-ru-rRU/strings.xml
@@ -82,9 +82,6 @@
Теплый Amoled
Гибридная Мамба
- Пробуждение умным чехлом
- Включить пробуждение откидной крышкой
- Пробуждение устройства через магнитную откидную крышку
@string/presets_dialog_title
Сбросить
diff --git a/DeviceSettings/res/values-sk-rSK/strings.xml b/DeviceSettings/res/values-sk-rSK/strings.xml
index 61231d8a..9762e72d 100644
--- a/DeviceSettings/res/values-sk-rSK/strings.xml
+++ b/DeviceSettings/res/values-sk-rSK/strings.xml
@@ -82,9 +82,6 @@
Teplý - Amoled
Hybrid Mamba
- Zobudenie preklopením krytu
- Povoliť zobudenie preklopením krytu
- Zobudenia zariadenia magnetickým krytom
@string/presets_dialog_title
Resetovať
diff --git a/DeviceSettings/res/values/strings.xml b/DeviceSettings/res/values/strings.xml
index 59e71b44..48d7413a 100644
--- a/DeviceSettings/res/values/strings.xml
+++ b/DeviceSettings/res/values/strings.xml
@@ -82,9 +82,6 @@
Warm Amoled
Hybrid Mamba
- Flip Cover Wakeup
- Enable Flip Cover Wakeup
- Wakeup device via magnetic Flip Cover
@string/presets_dialog_title
Reset
diff --git a/DeviceSettings/res/xml/preferences_xiaomi_parts.xml b/DeviceSettings/res/xml/preferences_xiaomi_parts.xml
index 7c3f745d..fcfc17b8 100644
--- a/DeviceSettings/res/xml/preferences_xiaomi_parts.xml
+++ b/DeviceSettings/res/xml/preferences_xiaomi_parts.xml
@@ -15,6 +15,7 @@
-->
+
@@ -123,15 +124,4 @@
android:icon="@drawable/ic_thermal" />
-
-
-
-
diff --git a/DeviceSettings/src/org/lineageos/settings/device/BootReceiver.java b/DeviceSettings/src/org/lineageos/settings/device/BootReceiver.java
index 638f74d8..6a1b4442 100644
--- a/DeviceSettings/src/org/lineageos/settings/device/BootReceiver.java
+++ b/DeviceSettings/src/org/lineageos/settings/device/BootReceiver.java
@@ -71,10 +71,6 @@ public class BootReceiver extends BroadcastReceiver implements Utils {
context.getContentResolver(), DeviceSettings.PREF_VIBRATION_STRENGTH, 80) / 100.0 * (DeviceSettings.MAX_VIBRATION - DeviceSettings.MIN_VIBRATION) + DeviceSettings.MIN_VIBRATION);
FileUtils.setValue(DeviceSettings.THERMAL_PATH, Settings.Secure.getString(
context.getContentResolver(), DeviceSettings.PREF_THERMAL));
- FileUtils.setValue(DeviceSettings.HALL_WAKEUP_PATH, Settings.Secure.getInt(
- context.getContentResolver(), DeviceSettings.PREF_HALL_WAKEUP, 1) == 1 ? "Y" : "N");
- FileUtils.setProp(DeviceSettings.HALL_WAKEUP_PROP, Settings.Secure.getInt(
- context.getContentResolver(), DeviceSettings.PREF_HALL_WAKEUP, 1) == 1);
boolean enabled = Settings.Secure.getInt(context.getContentResolver(), DeviceSettings.PREF_KEY_FPS_INFO, 0) == 1;
if (enabled) {
diff --git a/DeviceSettings/src/org/lineageos/settings/device/DeviceSettings.java b/DeviceSettings/src/org/lineageos/settings/device/DeviceSettings.java
index c7911215..3fc075c6 100644
--- a/DeviceSettings/src/org/lineageos/settings/device/DeviceSettings.java
+++ b/DeviceSettings/src/org/lineageos/settings/device/DeviceSettings.java
@@ -65,11 +65,6 @@ public class DeviceSettings extends PreferenceFragment implements
public static final String PREF_THERMAL = "thermal";
public static final String THERMAL_PATH = "/sys/devices/virtual/thermal/thermal_message/sconfig";
- private static final String CATEGORY_HALL_WAKEUP = "hall_wakeup";
- public static final String PREF_HALL_WAKEUP = "hall";
- public static final String HALL_WAKEUP_PATH = "/sys/module/hall/parameters/hall_toggle";
- public static final String HALL_WAKEUP_PROP = "persist.service.folio_daemon";
-
private static final String DEVICE_DOZE_PACKAGE_NAME = "com.advanced.settings.doze";
private static final String DEVICE_JASON_PACKAGE_NAME = "org.lineageos.settings.devicex";
@@ -127,13 +122,6 @@ public class DeviceSettings extends PreferenceFragment implements
mTHERMAL.setSummary(mTHERMAL.getEntry());
mTHERMAL.setOnPreferenceChangeListener(this);
- if (FileUtils.fileWritable(HALL_WAKEUP_PATH)) {
- SecureSettingSwitchPreference hall = (SecureSettingSwitchPreference) findPreference(PREF_HALL_WAKEUP);
- hall.setChecked(FileUtils.getValue(HALL_WAKEUP_PATH).equals("Y"));
- hall.setOnPreferenceChangeListener(this);
- } else {
- getPreferenceScreen().removePreference(findPreference(CATEGORY_HALL_WAKEUP));
- }
}
@Override
@@ -163,11 +151,6 @@ public class DeviceSettings extends PreferenceFragment implements
FileUtils.setValue(THERMAL_PATH, (String) value);
break;
- case PREF_HALL_WAKEUP:
- FileUtils.setValue(HALL_WAKEUP_PATH, (boolean) value ? "Y" : "N");
- FileUtils.setProp(HALL_WAKEUP_PROP, (boolean) value);
- break;
-
case PREF_KEY_FPS_INFO:
boolean enabled = (boolean) value;
Intent fpsinfo = new Intent(this.getContext(), FPSInfoService.class);
diff --git a/folio_daemon/Android.bp b/folio_daemon/Android.bp
deleted file mode 100755
index c609cfb1..00000000
--- a/folio_daemon/Android.bp
+++ /dev/null
@@ -1,21 +0,0 @@
-cc_binary {
- name: "folio_daemon",
-
- shared_libs: [
- "libandroid",
- "libcutils",
- "liblog",
- ],
-
- srcs: ["main.cpp"],
-
- cflags: [
- "-DLOG_TAG=\"folio_daemon\"",
- "-DLOG_NDEBUG=0",
- "-Wall",
- "-Werror",
- ],
-
- owner: "google",
-
-}
diff --git a/folio_daemon/main.cpp b/folio_daemon/main.cpp
deleted file mode 100644
index 1cda1ce5..00000000
--- a/folio_daemon/main.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright 2017 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.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// Hall-effect sensor type
-#define SENSOR_TYPE 33171016
-
-#define RETRY_LIMIT 120
-#define RETRY_PERIOD 30 // 30 seconds
-#define WARN_PERIOD (time_t)300 // 5 minutes
-
-/*
- * This simple daemon listens for events from the Hall-effect sensor and writes
- * the appropriate SW_LID event to a uinput node. This allows the screen to be
- * locked with a magnetic folio case.
- */
-int main(void) {
- int uinputFd;
- int err;
- struct uinput_user_dev uidev;
- ASensorManager *sensorManager = nullptr;
- ASensorRef hallSensor;
- ALooper *looper;
- ASensorEventQueue *eventQueue = nullptr;
- time_t lastWarn = 0;
- int attemptCount = 0;
-
- ALOGI("Started");
-
- uinputFd = TEMP_FAILURE_RETRY(open("/dev/uinput", O_WRONLY | O_NONBLOCK));
- if (uinputFd < 0) {
- ALOGE("Unable to open uinput node: %s", strerror(errno));
- goto out;
- }
-
- err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SW))
- | TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_EVBIT, EV_SYN))
- | TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_SET_SWBIT, SW_LID));
- if (err != 0) {
- ALOGE("Unable to enable SW_LID events: %s", strerror(errno));
- goto out;
- }
-
- memset(&uidev, 0, sizeof (uidev));
- snprintf(uidev.name, UINPUT_MAX_NAME_SIZE, "uinput-folio");
- uidev.id.bustype = BUS_VIRTUAL;
- uidev.id.vendor = 0;
- uidev.id.product = 0;
- uidev.id.version = 0;
-
- err = TEMP_FAILURE_RETRY(write(uinputFd, &uidev, sizeof (uidev)));
- if (err < 0) {
- ALOGE("Write user device to uinput node failed: %s", strerror(errno));
- goto out;
- }
-
- err = TEMP_FAILURE_RETRY(ioctl(uinputFd, UI_DEV_CREATE));
- if (err < 0) {
- ALOGE("Unable to create uinput device: %s", strerror(errno));
- goto out;
- }
-
- ALOGI("Successfully registered uinput-folio for SW_LID events");
-
- // Get Hall-effect sensor events from the NDK
- sensorManager = ASensorManager_getInstanceForPackage(nullptr);
- /*
- * As long as we are unable to get the sensor handle, periodically retry
- * and emit an error message at a low frequency to prevent high CPU usage
- * and log spam. If we simply exited with an error here, we would be
- * immediately restarted and fail in the same way indefinitely.
- */
- while (true) {
- time_t now = time(NULL);
- hallSensor = ASensorManager_getDefaultSensor(sensorManager,
- SENSOR_TYPE);
- if (hallSensor != nullptr) {
- break;
- }
-
- if (++attemptCount >= RETRY_LIMIT) {
- ALOGE("Retries exhausted; exiting");
- goto out;
- } else if (now > lastWarn + WARN_PERIOD) {
- ALOGE("Unable to get Hall-effect sensor");
- lastWarn = now;
- }
-
- sleep(RETRY_PERIOD);
- }
-
- looper = ALooper_forThread();
- if (looper == nullptr) {
- looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
- }
-
- eventQueue = ASensorManager_createEventQueue(sensorManager, looper, 0, NULL,
- NULL);
- err = ASensorEventQueue_registerSensor(eventQueue, hallSensor,
- ASensor_getMinDelay(hallSensor),
- 10000);
- if (err < 0) {
- ALOGE("Unable to register for Hall-effect sensor events");
- goto out;
- }
-
- ALOGI("Starting polling loop");
-
- // Polling loop
- while (ALooper_pollAll(-1, NULL, NULL, NULL) == 0) {
- int eventCount = 0;
- ASensorEvent sensorEvent;
- while (ASensorEventQueue_getEvents(eventQueue, &sensorEvent, 1) > 0) {
- // 1 means closed; 0 means open
- int isClosed = sensorEvent.data[0] > 0.0f ? 1 : 0;
- struct input_event event;
- event.type = EV_SW;
- event.code = SW_LID;
- event.value = isClosed;
- err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof (event)));
- if (err < 0) {
- ALOGE("Write EV_SW to uinput node failed: %s", strerror(errno));
- goto out;
- }
-
- // Force a flush with an EV_SYN
- event.type = EV_SYN;
- event.code = SYN_REPORT;
- event.value = 0;
- err = TEMP_FAILURE_RETRY(write(uinputFd, &event, sizeof (event)));
- if (err < 0) {
- ALOGE("Write EV_SYN to uinput node failed: %s",
- strerror(errno));
- goto out;
- }
-
- ALOGI("Sent lid %s event", isClosed ? "closed" : "open");
- eventCount++;
- }
-
- if (eventCount == 0) {
- ALOGE("Poll returned with zero events: %s", strerror(errno));
- break;
- }
- }
-
-out:
- // Clean up
- if (sensorManager != nullptr && eventQueue != nullptr) {
- ASensorManager_destroyEventQueue(sensorManager, eventQueue);
- }
-
- if (uinputFd >= 0) {
- close(uinputFd);
- }
-
- // The loop can only be exited via failure or signal
- return 1;
-}
diff --git a/rootdir/etc/init.xiaomi_parts.rc b/rootdir/etc/init.xiaomi_parts.rc
index 7484be21..0a98ad87 100644
--- a/rootdir/etc/init.xiaomi_parts.rc
+++ b/rootdir/etc/init.xiaomi_parts.rc
@@ -15,11 +15,9 @@
#
on boot
- # XiaomiParts
+ # Haptic strength
chown system system /sys/devices/virtual/timed_output/vibrator/vtg_level
chmod 0660 /sys/devices/virtual/timed_output/vibrator/vtg_level
- chown system system /sys/module/hall/parameters/hall_toggle
- chmod 0660 /sys/module/hall/parameters/hall_toggle
# FPS
chown system system /sys/devices/virtual/graphics/fb0/measured_fps
diff --git a/sdm660.mk b/sdm660.mk
index 42501938..cc2d04bd 100644
--- a/sdm660.mk
+++ b/sdm660.mk
@@ -228,10 +228,6 @@ PRODUCT_PACKAGES += \
android.hardware.drm@1.0-service \
android.hardware.drm@1.3-service.clearkey
-# Folio
-PRODUCT_PACKAGES += \
- folio_daemon
-
# Freeform Multiwindow
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.freeform_window_management.xml
diff --git a/sepolicy/private/file_contexts b/sepolicy/private/file_contexts
index 5ef7cdae..e45924bd 100644
--- a/sepolicy/private/file_contexts
+++ b/sepolicy/private/file_contexts
@@ -1,5 +1,4 @@
# Executables
-/system/bin/folio_daemon u:object_r:folio_daemon_exec:s0
/system/bin/chargeonlymode u:object_r:charger_exec:s0
# OTA packages
diff --git a/sepolicy/private/folio_daemon.te b/sepolicy/private/folio_daemon.te
deleted file mode 100644
index f48a3b2f..00000000
--- a/sepolicy/private/folio_daemon.te
+++ /dev/null
@@ -1,15 +0,0 @@
-type folio_daemon, domain, coredomain;
-type folio_daemon_exec, system_file_type, exec_type, file_type;
-
-init_daemon_domain(folio_daemon)
-
-allow folio_daemon binder_device:chr_file rw_file_perms;
-allow folio_daemon uhid_device:chr_file rw_file_perms;
-
-allow folio_daemon system_server:unix_stream_socket rw_socket_perms_no_ioctl;
-
-binder_use(folio_daemon)
-binder_call(folio_daemon, system_server)
-
-allow folio_daemon sensorservice_service:service_manager find;
-allow folio_daemon permission_service:service_manager find;
diff --git a/sepolicy/private/system_server.te b/sepolicy/private/system_server.te
index 8f8c524d..4cdfaafb 100644
--- a/sepolicy/private/system_server.te
+++ b/sepolicy/private/system_server.te
@@ -1,4 +1,2 @@
-binder_call(system_server, folio_daemon)
-
# Allow system_server to set persist_camera_prop
get_prop(system_server, vendor_persist_camera_prop)
diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te
index 689d1ddc..16995b65 100644
--- a/sepolicy/vendor/file.te
+++ b/sepolicy/vendor/file.te
@@ -10,9 +10,6 @@ type fingerprintd_device, file_type, dev_type;
type persist_fingerprint_file, file_type;
type sysfs_fingerprint, sysfs_type, fs_type;
-# Hall Switch
-type hall_dev, sysfs_type, fs_type;
-
# Kcal
type kcal_dev, sysfs_type, fs_type;
diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts
index 7b76e091..fa755553 100644
--- a/sepolicy/vendor/file_contexts
+++ b/sepolicy/vendor/file_contexts
@@ -27,9 +27,6 @@
/data/vendor/goodix(/.*)? u:object_r:fingerprint_vendor_data_file:s0
/dev/goodix_fp u:object_r:fingerprint_device:s0
-# Hall Switch
-/sys/module/hall/parameters(/.*)? u:object_r:hall_dev:s0
-
# HVDCP
/sys/devices(/platform)?/soc/[a-z0-9]+\.i2c/i2c-[0-9]+/[0-9]+-[a-z0-9]+/[a-z0-9]+\.i2c:qcom,[a-z0-9]+@[a-z0-9]:qcom,smb[a-z0-9]+-parallel-slave@[0-9]+/power_supply/parallel(/.*)? u:object_r:sysfs_usb_supply:s0
diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts
index f4642658..7f7abf7a 100644
--- a/sepolicy/vendor/property_contexts
+++ b/sepolicy/vendor/property_contexts
@@ -25,9 +25,6 @@ sys.fp. u:object_r:hal_fingerprint_prop:s0
ro.boot.fpsensor u:object_r:hal_fingerprint_prop:s0
persist.sys.fp.info u:object_r:hal_fingerprint_prop:s0
-# Hall wakeup
-persist.service.folio_daemon u:object_r:system_prop:s0
-
# Media
gpu.stats.debug.level u:object_r:vendor_default_prop:s0
diff --git a/sepolicy/vendor/system_app.te b/sepolicy/vendor/system_app.te
index 6f1ce2bf..3b0897b6 100644
--- a/sepolicy/vendor/system_app.te
+++ b/sepolicy/vendor/system_app.te
@@ -1,7 +1,5 @@
allow system_app blkio_dev:dir search;
allow system_app hal_mlipay_default:binder call;
-allow system_app hall_dev:file rw_file_perms;
-allow system_app hall_dev:dir search;
allow system_app kcal_dev:file rw_file_perms;
allow system_app kcal_dev:dir search;
allow system_app proc_vmallocinfo:file read;
diff --git a/sepolicy/vendor/ueventd.te b/sepolicy/vendor/ueventd.te
index b64089c1..b1b25e3f 100644
--- a/sepolicy/vendor/ueventd.te
+++ b/sepolicy/vendor/ueventd.te
@@ -1,6 +1,3 @@
-allow ueventd hall_dev:dir r_dir_perms;
-allow ueventd hall_dev:file rw_file_perms;
-allow ueventd hall_dev:lnk_file r_file_perms;
allow ueventd ir_dev_file:chr_file { create setattr };
allow ueventd kcal_dev:dir r_dir_perms;
allow ueventd kcal_dev:file rw_file_perms;