summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt4
-rw-r--r--aidl/livedisplay/Android.bp20
-rw-r--r--aidl/touch/Android.bp14
-rw-r--r--aidl/vibrator/qti/Android.bp4
-rw-r--r--doze/proguard.flags1
-rw-r--r--doze/src/org/lineageos/settings/doze/DozeSettingsFragment.kt51
-rw-r--r--eSimSwitcher/src/org/lineageos/settings/esimswitcher/EsimSettingsFragment.kt4
-rw-r--r--oplus-fwk/src/com/oplus/osense/OsenseResClient.java55
-rw-r--r--oplus-fwk/src/com/oplus/uifirst/IOplusUIFirstManager.java10
-rw-r--r--oplus-fwk/src/com/oplus/uifirst/OplusUIFirstManager.java17
10 files changed, 130 insertions, 50 deletions
diff --git a/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt b/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt
index b5899a3..1854e43 100644
--- a/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt
+++ b/KeyHandler/src/org/lineageos/settings/device/ButtonSettingsFragment.kt
@@ -6,9 +6,9 @@
package org.lineageos.settings.device
import android.os.Bundle
-import androidx.preference.PreferenceFragmentCompat
+import com.android.settingslib.widget.SettingsBasePreferenceFragment
-class ButtonSettingsFragment : PreferenceFragmentCompat() {
+class ButtonSettingsFragment : SettingsBasePreferenceFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.button_panel, rootKey)
}
diff --git a/aidl/livedisplay/Android.bp b/aidl/livedisplay/Android.bp
index 7cb80a8..437e686 100644
--- a/aidl/livedisplay/Android.bp
+++ b/aidl/livedisplay/Android.bp
@@ -33,19 +33,19 @@ cc_binary {
name: "vendor.lineage.livedisplay-service.oplus",
init_rc: ["vendor.lineage.livedisplay-service.oplus.rc"],
vintf_fragments: select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AB"), {
- "true": ["vendor.lineage.livedisplay-service.oplus-ab.xml"],
+ true: ["vendor.lineage.livedisplay-service.oplus-ab.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
- "true": ["vendor.lineage.livedisplay-service.oplus-af.xml"],
+ true: ["vendor.lineage.livedisplay-service.oplus-af.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_DM"), {
- "true": ["vendor.lineage.livedisplay-service.oplus-dm.xml"],
+ true: ["vendor.lineage.livedisplay-service.oplus-dm.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
- "false": [],
+ false: [],
default: ["vendor.lineage.livedisplay-service.oplus-pa.xml"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
- "false": [],
+ false: [],
default: ["vendor.lineage.livedisplay-service.oplus-se.xml"],
}),
relative_install_path: "hw",
@@ -71,19 +71,19 @@ cc_binary {
"vendor.lineage.livedisplay-oplus-headers",
],
cflags: select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AB"), {
- "true": ["-DENABLE_AB=true"],
+ true: ["-DENABLE_AB=true"],
default: ["-DENABLE_AB=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_AF"), {
- "true": ["-DENABLE_AF=true"],
+ true: ["-DENABLE_AF=true"],
default: ["-DENABLE_AF=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_DM"), {
- "true": ["-DENABLE_DM=true"],
+ true: ["-DENABLE_DM=true"],
default: ["-DENABLE_DM=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_PA"), {
- "false": ["-DENABLE_PA=false"],
+ false: ["-DENABLE_PA=false"],
default: ["-DENABLE_PA=true"],
}) + select(soong_config_variable("OPLUS_LINEAGE_LIVEDISPLAY_HAL", "ENABLE_SE"), {
- "false": ["-DENABLE_SE=false"],
+ false: ["-DENABLE_SE=false"],
default: ["-DENABLE_SE=true"],
}),
proprietary: true,
diff --git a/aidl/touch/Android.bp b/aidl/touch/Android.bp
index 5432ac5..d8828af 100644
--- a/aidl/touch/Android.bp
+++ b/aidl/touch/Android.bp
@@ -7,13 +7,13 @@ cc_binary {
name: "vendor.lineage.touch-service.oplus",
init_rc: ["vendor.lineage.touch-service.oplus.rc"],
vintf_fragments: select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_GM"), {
- "true": ["vendor.lineage.touch-service.oplus-gm.xml"],
+ true: ["vendor.lineage.touch-service.oplus-gm.xml"],
default: [],
}) + select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_HTPR"), {
- "false": [],
+ false: [],
default: ["vendor.lineage.touch-service.oplus-htpr.xml"],
}) + select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_TG"), {
- "false": [],
+ false: [],
default: ["vendor.lineage.touch-service.oplus-tg.xml"],
}),
vendor: true,
@@ -40,16 +40,16 @@ cc_binary {
default: [],
}),
cflags: select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_GM"), {
- "true": ["-DENABLE_GM=true"],
+ true: ["-DENABLE_GM=true"],
default: ["-DENABLE_GM=false"],
}) + select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_HTPR"), {
- "false": ["-DENABLE_HTPR=false"],
+ false: ["-DENABLE_HTPR=false"],
default: ["-DENABLE_HTPR=true"],
}) + select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "ENABLE_TG"), {
- "false": ["-DENABLE_TG=false"],
+ false: ["-DENABLE_TG=false"],
default: ["-DENABLE_TG=true"],
}) + select(soong_config_variable("OPLUS_LINEAGE_TOUCH_HAL", "USE_OPLUSTOUCH"), {
- "true": ["-DUSE_OPLUSTOUCH=true"],
+ true: ["-DUSE_OPLUSTOUCH=true"],
default: ["-DUSE_OPLUSTOUCH=false"],
}),
}
diff --git a/aidl/vibrator/qti/Android.bp b/aidl/vibrator/qti/Android.bp
index 970d486..ef80d14 100644
--- a/aidl/vibrator/qti/Android.bp
+++ b/aidl/vibrator/qti/Android.bp
@@ -5,7 +5,7 @@ cc_library_shared {
name: "vendor.qti.hardware.vibrator.impl.oplus",
vendor: true,
cflags: Common_CFlags + select(soong_config_variable("OPLUS_LINEAGE_VIBRATOR_HAL", "USE_EFFECT_STREAM"), {
- "true": ["-DUSE_EFFECT_STREAM"],
+ true: ["-DUSE_EFFECT_STREAM"],
default: [],
}),
srcs: [
@@ -18,7 +18,7 @@ cc_library_shared {
"libbinder_ndk",
"android.hardware.vibrator-V1-ndk",
] + select(soong_config_variable("OPLUS_LINEAGE_VIBRATOR_HAL", "USE_EFFECT_STREAM"), {
- "true": ["liboplusvibratoreffect"],
+ true: ["liboplusvibratoreffect"],
default: [],
}),
export_include_dirs: ["include"],
diff --git a/doze/proguard.flags b/doze/proguard.flags
index eb350a0..d37ae23 100644
--- a/doze/proguard.flags
+++ b/doze/proguard.flags
@@ -2,7 +2,6 @@
public <init>(android.content.Context, android.util.AttributeSet);
}
--keep class ** extends androidx.preference.PreferenceFragment
-keep class org.lineageos.settings.doze.* {
*;
}
diff --git a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.kt b/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.kt
index 071c7be..fd3a907 100644
--- a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.kt
+++ b/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021-2024 The LineageOS Project
+ * SPDX-FileCopyrightText: 2021-2025 The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
@@ -11,18 +11,15 @@ import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.os.Looper
-import android.widget.CompoundButton
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
-import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.android.settingslib.widget.MainSwitchPreference
+import com.android.settingslib.widget.SettingsBasePreferenceFragment
-class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener,
- CompoundButton.OnCheckedChangeListener {
+class DozeSettingsFragment : SettingsBasePreferenceFragment(), Preference.OnPreferenceChangeListener {
private lateinit var alwaysOnDisplayPreference: SwitchPreferenceCompat
- private lateinit var switchBar: MainSwitchPreference
private var pickUpPreference: ListPreference? = null
private var pocketPreference: SwitchPreferenceCompat? = null
@@ -44,8 +41,8 @@ class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreference
}
val dozeEnabled = Utils.isDozeEnabled(requireContext())
- switchBar = findPreference(Utils.DOZE_ENABLE)!!
- switchBar.addOnSwitchChangeListener(this)
+ val switchBar = findPreference<MainSwitchPreference>(Utils.DOZE_ENABLE)!!
+ switchBar.onPreferenceChangeListener = this
switchBar.isChecked = dozeEnabled
alwaysOnDisplayPreference = findPreference(Utils.ALWAYS_ON_DISPLAY)!!
@@ -83,27 +80,29 @@ class DozeSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreference
}
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
- if (preference.key == Utils.ALWAYS_ON_DISPLAY) {
- Utils.enableAlwaysOn(requireContext(), newValue as Boolean)
- }
- handler.post { Utils.checkDozeService(requireContext()) }
- return true
- }
-
- override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
- Utils.enableDoze(requireContext(), isChecked)
- Utils.checkDozeService(requireContext())
-
- switchBar.isChecked = isChecked
+ when (preference.key) {
+ Utils.ALWAYS_ON_DISPLAY -> {
+ val isChecked = newValue as Boolean
+ Utils.enableAlwaysOn(requireContext(), isChecked)
+ }
+ Utils.DOZE_ENABLE -> {
+ val isChecked = newValue as Boolean
+ Utils.enableDoze(requireContext(), isChecked)
+ Utils.checkDozeService(requireContext())
+
+ if (!isChecked) {
+ Utils.enableAlwaysOn(requireContext(), false)
+ alwaysOnDisplayPreference.isChecked = false
+ }
- if (!isChecked) {
- Utils.enableAlwaysOn(requireContext(), false)
- alwaysOnDisplayPreference.isChecked = false
+ alwaysOnDisplayPreference.isEnabled = isChecked
+ pickUpPreference?.isEnabled = isChecked
+ pocketPreference?.isEnabled = isChecked
+ }
}
- alwaysOnDisplayPreference.isEnabled = isChecked
- pickUpPreference?.isEnabled = isChecked
- pocketPreference?.isEnabled = isChecked
+ handler.post { Utils.checkDozeService(requireContext()) }
+ return true
}
}
diff --git a/eSimSwitcher/src/org/lineageos/settings/esimswitcher/EsimSettingsFragment.kt b/eSimSwitcher/src/org/lineageos/settings/esimswitcher/EsimSettingsFragment.kt
index 5d4d289..7f012a5 100644
--- a/eSimSwitcher/src/org/lineageos/settings/esimswitcher/EsimSettingsFragment.kt
+++ b/eSimSwitcher/src/org/lineageos/settings/esimswitcher/EsimSettingsFragment.kt
@@ -8,11 +8,11 @@ package org.lineageos.settings.esimswitcher
import android.app.AlertDialog
import android.os.Bundle
import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
+import com.android.settingslib.widget.SettingsBasePreferenceFragment
import org.lineageos.settings.esimswitcher.R
-class EsimSettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener {
+class EsimSettingsFragment : SettingsBasePreferenceFragment(), Preference.OnPreferenceChangeListener {
private lateinit var controller: EsimController
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
diff --git a/oplus-fwk/src/com/oplus/osense/OsenseResClient.java b/oplus-fwk/src/com/oplus/osense/OsenseResClient.java
new file mode 100644
index 0000000..b9ae4dd
--- /dev/null
+++ b/oplus-fwk/src/com/oplus/osense/OsenseResClient.java
@@ -0,0 +1,55 @@
+/*
+ * SPDX-FileCopyrightText: 2025 The LineageOS Project
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package com.oplus.osense;
+
+import android.os.Bundle;
+import android.view.MotionEvent;
+
+public class OsenseResClient {
+ public static OsenseResClient get(Class clazz) {
+ return new OsenseResClient();
+ }
+
+ public void requestSysResource(int eventId, Bundle extra) {}
+
+ public void releaseSysResource(int eventId) {}
+
+ public long osenseSetSceneAction(Object request) {
+ return 0L;
+ }
+
+ public void osenseClrSceneAction(long handle) {}
+
+ public void osenseSetNotification(Object request) {}
+
+ public void osenseSetCtrlData(Object request) {}
+
+ public void osenseClrCtrlData() {}
+
+ public void reportKeyThread(String threadName, int tid, int supportedEventId, Bundle extra) {}
+
+ public void removeKeyThread(int tid, Bundle extra) {}
+
+ public void removeKeyThread(String threadName, Bundle extra) {}
+
+ public void setHookKeyThread(String packageName, String threadName, int op, int pid, int[] tids) {}
+
+ public void reportEvent(int eventId, Bundle extra) {}
+
+ public void registerScene(int sceneId, Object listener) {}
+
+ public void unregisterScene(int sceneId, Object listener) {}
+
+ public int osenseGetModeStatus(int mode) {
+ return 0;
+ }
+
+ public long[][][] osenseGetPerfLimit() {
+ return null;
+ }
+
+ public void osenseSendFling(MotionEvent ev, int duration) {}
+}
diff --git a/oplus-fwk/src/com/oplus/uifirst/IOplusUIFirstManager.java b/oplus-fwk/src/com/oplus/uifirst/IOplusUIFirstManager.java
new file mode 100644
index 0000000..ca758bd
--- /dev/null
+++ b/oplus-fwk/src/com/oplus/uifirst/IOplusUIFirstManager.java
@@ -0,0 +1,10 @@
+/*
+ * SPDX-FileCopyrightText: 2025 The LineageOS Project
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package com.oplus.uifirst;
+
+public interface IOplusUIFirstManager {
+ default void setBinderThreadUxFlag(int pid, int flag) {}
+}
diff --git a/oplus-fwk/src/com/oplus/uifirst/OplusUIFirstManager.java b/oplus-fwk/src/com/oplus/uifirst/OplusUIFirstManager.java
new file mode 100644
index 0000000..ebec5c5
--- /dev/null
+++ b/oplus-fwk/src/com/oplus/uifirst/OplusUIFirstManager.java
@@ -0,0 +1,17 @@
+/*
+ * SPDX-FileCopyrightText: 2025 The LineageOS Project
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package com.oplus.uifirst;
+
+public class OplusUIFirstManager implements IOplusUIFirstManager {
+ private static OplusUIFirstManager sInstance = null;
+
+ public static OplusUIFirstManager getInstance() {
+ if (sInstance == null) {
+ sInstance = new OplusUIFirstManager();
+ }
+ return sInstance;
+ }
+}