Fix: Opening KompaktX's panel turns off Adaptive Brightness - #6
Open
chadchad4423 wants to merge 1 commit into
Open
Fix: Opening KompaktX's panel turns off Adaptive Brightness#6chadchad4423 wants to merge 1 commit into
chadchad4423 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 wroteSettings.System.SCREEN_BRIGHTNESS_MODE_MANUALat 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):