diff --git a/app/src/main/java/io/github/soclear/oneuix/ui/category/DetailPaneSystemUI.kt b/app/src/main/java/io/github/soclear/oneuix/ui/category/DetailPaneSystemUI.kt
index f9edec93..105e9e78 100644
--- a/app/src/main/java/io/github/soclear/oneuix/ui/category/DetailPaneSystemUI.kt
+++ b/app/src/main/java/io/github/soclear/oneuix/ui/category/DetailPaneSystemUI.kt
@@ -809,6 +809,15 @@ fun DetailPaneSystemUI(
onEvent(SystemUIEvent.AOD.HideAODStatusBar(it))
}
)
+ SwitchItem(
+ icon = ImageVector.vectorResource(id = R.drawable.light_mode),
+ title = stringResource(id = R.string.removeAODBrightnessLimit_title),
+ summary = stringResource(id = R.string.removeAODBrightnessLimit_summary),
+ checked = uiState.aod.removeAODBrightnessLimit,
+ onCheckedChange = {
+ onEvent(SystemUIEvent.AOD.RemoveAODBrightnessLimit(it))
+ }
+ )
SwitchItem(
icon = ImageVector.vectorResource(id = R.drawable.today),
title = stringResource(id = R.string.aodLockSupportLunar_title),
@@ -1160,6 +1169,8 @@ sealed interface SystemUIEvent {
@JvmInline
value class HideAODStatusBar(val value: Boolean) : AOD
+ @JvmInline
+ value class RemoveAODBrightnessLimit(val value: Boolean) : AOD
@JvmInline
value class AODLockSupportLunar(val value: Boolean) : AOD
@@ -1749,6 +1760,16 @@ private fun SettingViewModel.onAODEvent(event: SystemUIEvent.AOD) {
)
}
+ is SystemUIEvent.AOD.RemoveAODBrightnessLimit -> {
+ preference.copy(
+ systemUI = preference.systemUI.copy(
+ aod = preference.systemUI.aod.copy(
+ removeAODBrightnessLimit = event.value
+ )
+ )
+ )
+ }
+
is SystemUIEvent.AOD.AODLockSupportLunar -> {
preference.copy(
systemUI = preference.systemUI.copy(
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index f2550aaa..2172d318 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -155,6 +155,8 @@
Afficher uniquement le fond d’écran sur l’AOD
Afficher uniquement le fond d’écran sur l’AOD sans modifier l’écran de verrouillage normal. Activez le fond d’écran de verrouillage dans les paramètres AOD. Pour l’icône d’empreinte, accédez à Paramètres → Écran de verrouillage et AOD → Verrouillage de l’écran et biométrie → Empreintes → Afficher l’icône lorsque l’écran est éteint, puis sélectionnez « Appuyer pour afficher » ou « Jamais ». Redémarrez l’interface système pour appliquer les modifications.
Masquer la barre d\'état sur l\'AOD
+ Supprimer la limite de luminosité de l\'AOD
+ La luminosité de l\'AOD suit celle du système. Redémarrez System UI pour appliquer.
Masquer les informations de charge sur l\'AOD
Afficher le calendrier lunaire chinois sur l\'AOD
Afficher les jours fériés chinois dans le calendrier
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 54666b60..411570c5 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -155,6 +155,8 @@
AOD에 배경화면만 표시
일반 잠금화면은 변경하지 않고 AOD에 배경화면만 표시합니다. 시스템 AOD 설정에서 잠금화면 배경화면 표시를 켜세요. 지문 아이콘은 설정 → 잠금화면 및 AOD → 화면 잠금 및 생체 인식 → 지문 → 화면이 꺼져 있을 때 아이콘 표시에서 “눌러서 표시” 또는 “표시 안 함”을 선택하세요. 적용하려면 시스템 UI를 다시 시작하세요.
AOD 상태바 숨기기
+ AOD 밝기 제한 해제
+ AOD 밝기가 시스템 밝기를 따릅니다. 적용하려면 System UI를 다시 시작하세요.
AOD 충전 정보 숨기기
AOD/잠금 화면에 음력 표시
캘린더에 중국 공휴일 표시
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 631909fd..1aaad6ff 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -155,6 +155,8 @@
Только обои на AOD
Показывать на AOD только обои, не изменяя обычный экран блокировки. Включите отображение обоев экрана блокировки в настройках AOD. Для значка отпечатка пальца откройте: Настройки → Экран блокировки и AOD → Блокировка экрана и биометрия → Отпечатки пальцев → Показывать значок при выключенном экране, затем выберите «Касание для отображения» или «Никогда». Для применения перезапустите интерфейс системы.
Скрыть строку состояния на AOD
+ Снять ограничение яркости AOD
+ Яркость AOD будет следовать системной яркости. Перезапустите System UI для применения.
Скрыть информацию о зарядке на AOD
Лунный календарь на AOD и экране блокировки
Китайские праздники в календаре
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index 9178497f..bada2875 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -155,6 +155,8 @@
息屏提醒仅显示壁纸
仅保留息屏壁纸,不影响亮屏锁屏。需在系统息屏提醒设置中开启锁屏壁纸。指纹图标请前往:设置 → 锁定屏幕和息屏提醒 → 屏幕锁定和生物识别 → 指纹 → 屏幕关闭时显示图标,选择“点击来显示”或“从不”。重启系统 UI 后生效。
隐藏息屏提醒的状态栏
+ 移除息屏提醒亮度限制
+ 息屏提醒亮度跟随系统亮度。重启系统 UI 后生效。
隐藏息屏提醒的充电信息
息屏提醒显示中国农历
日历中显示中国节假日
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8fbf438a..40fb4e64 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -155,6 +155,8 @@
Wallpaper-only AOD
Show only the AOD wallpaper without changing the normal lock screen. Enable lock screen wallpaper in AOD settings. For the fingerprint icon, go to Settings → Lock screen and AOD → Screen lock and biometrics → Fingerprints → Show icon when screen is off, and select “Tap to show” or “Never”. Restart System UI to apply.
Hide AOD status bar
+ Remove AOD brightness limit
+ Let AOD brightness follow the system brightness. Restart System UI to take effect.
Hide AOD charging information
Show Chinese Lunar calendar on AOD/Lock screen
Show Chinese holidays in Calendar
diff --git a/common/src/main/java/io/github/soclear/oneuix/common/Preference.kt b/common/src/main/java/io/github/soclear/oneuix/common/Preference.kt
index 5ccb35d1..c0038cde 100644
--- a/common/src/main/java/io/github/soclear/oneuix/common/Preference.kt
+++ b/common/src/main/java/io/github/soclear/oneuix/common/Preference.kt
@@ -147,6 +147,7 @@ data class Preference(
val hideAODStatusBar: Boolean = false,
val hideAODChargingInfo: Boolean = false,
val aodLockSupportLunar: Boolean = false,
+ val removeAODBrightnessLimit: Boolean = false,
)
@Serializable
diff --git a/hook/src/main/java/io/github/soclear/oneuix/hook/Main.kt b/hook/src/main/java/io/github/soclear/oneuix/hook/Main.kt
index 22f6e6fc..48bc511d 100644
--- a/hook/src/main/java/io/github/soclear/oneuix/hook/Main.kt
+++ b/hook/src/main/java/io/github/soclear/oneuix/hook/Main.kt
@@ -469,6 +469,10 @@ class Main : XposedModule() {
AOD.hideAODStatusBar()
}
+ if (preference.systemUI.aod.removeAODBrightnessLimit) {
+ AOD.removeAODBrightnessLimit()
+ }
+
if (preference.systemUI.aod.aodLockSupportLunar) {
AOD.aodLockSupportLunar()
}
diff --git a/hook/src/main/java/io/github/soclear/oneuix/hook/systemui/AOD.kt b/hook/src/main/java/io/github/soclear/oneuix/hook/systemui/AOD.kt
index e57dbaf5..67378df4 100644
--- a/hook/src/main/java/io/github/soclear/oneuix/hook/systemui/AOD.kt
+++ b/hook/src/main/java/io/github/soclear/oneuix/hook/systemui/AOD.kt
@@ -3,11 +3,13 @@ package io.github.soclear.oneuix.hook.systemui
import android.annotation.SuppressLint
import android.graphics.Canvas
import android.os.Build
+import android.provider.Settings
import android.view.View
import android.view.ViewGroup
import io.github.libxposed.api.XposedInterface
import io.github.libxposed.api.XposedModule
import io.github.soclear.oneuix.hook.util.afterAttachTry
+import io.github.soclear.oneuix.hook.util.currentApplication
import io.github.soclear.oneuix.hook.util.reflect
import io.github.soclear.oneuix.hook.util.xlog
@@ -99,4 +101,27 @@ object AOD {
xposedModule.hook(method).intercept(hooker)
}
}
+
+ context(xposedModule: XposedModule)
+ fun removeAODBrightnessLimit() = afterAttachTry {
+ classLoader.loadClass("com.android.systemui.doze.AODScreenBrightness")
+ .getDeclaredMethod("updateDozeBrightness", Int::class.java, Int::class.java, Int::class.java)
+ .let { xposedModule.hook(it) }
+ .intercept { chain ->
+ try {
+ val min = runCatching { chain.thisObject.reflect["brightnessMin"] as? Int }.getOrNull() ?: 1
+ val max = runCatching { chain.thisObject.reflect["brightnessMax"] as? Int }.getOrNull() ?: 255
+ val resolver = currentApplication()?.contentResolver
+ val current = resolver?.let { Settings.System.getInt(it, "screen_brightness", -1) } ?: -1
+ if (current > 0) {
+ val newArgs = chain.args.toTypedArray()
+ newArgs[2] = current.coerceIn(min, max)
+ return@intercept chain.proceed(newArgs)
+ }
+ } catch (t: Throwable) {
+ xlog(t)
+ }
+ chain.proceed()
+ }
+ }
}