Skip to content

Fix: Opening KompaktX's panel turns off Adaptive Brightness - #6

Open
chadchad4423 wants to merge 1 commit into
ScreenSensitive:mainfrom
chadchad4423:fix/no-mode-force-on-panel-open
Open

Fix: Opening KompaktX's panel turns off Adaptive Brightness#6
chadchad4423 wants to merge 1 commit into
ScreenSensitive:mainfrom
chadchad4423:fix/no-mode-force-on-panel-open

Conversation

@chadchad4423

@chadchad4423 chadchad4423 commented Aug 25, 2026

Copy link
Copy Markdown

Fix: Opening KompaktX's panel turns off Adaptive Brightness

buildBrightnessSection() — the reachable brightness UI shown on KompaktX's Settings screen (sun icon / slider / percentage) — unconditionally wrote Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL at the top of the function, every time the section was built. That meant simply opening the panel to look at it, without touching the slider at all, silently turned off Adaptive Brightness.

Stock Android only switches to Manual mode when the user actually drags a brightness slider — not from a settings screen merely being displayed. This PR removes that unconditional mode-forcing write so the panel matches that behavior: opening it and not touching the slider leaves the current brightness mode (including Adaptive) untouched, while actually dragging the slider still switches to Manual as expected.

Testing

Verified on a physical Mudita Kompakt (MuditaOS K 1.5):

  1. Enabled Adaptive Brightness, opened KompaktX's panel without touching the slider — Adaptive Brightness stayed on.
  2. Actually dragged the brightness slider — Adaptive Brightness correctly flipped off, matching stock Android's own slider-drag behavior.

buildBrightnessSection() and buildBrightnessSubPanel() each unconditionally
wrote Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL at the top of the
function, as a side effect of building that view -- not in response to any
touch. That meant opening KompaktX's Quick Settings brightness row, or just
tapping "Bright" to expand its sub-panel, silently disabled Adaptive
Brightness even if the slider was never touched.

buildBrightnessSection's slider drag and sun-icon tap already go through
applyBrightness(), which forces manual mode on its own, so removing the
top-of-function write there is a pure deletion with no behavior change for
actual interaction.

buildBrightnessSubPanel's slider drag writes Settings.System.SCREEN_BRIGHTNESS
directly rather than through applyBrightness(), so its mode-forcing moved
into the ACTION_DOWN/ACTION_MOVE branch instead of being deleted outright --
dragging that slider still disables Adaptive Brightness, matching stock
Android's own slider-drag behavior; merely opening the sub-panel no longer
does.

Independent of and narrower in scope than the wake-loop fix on
fix/preserve-adaptive-brightness (which this branch does not include, since
it's based on unmodified upstream main) -- see PROJECT-STATUS.md for how the
two relate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant