Skip to content

Incomplete migration from statusBarEnabled to statusBarMode leaves multiple HomeFragment checks using stale old preference #29

@sophiehicks1

Description

@sophiehicks1

🔴 Incomplete migration from statusBarEnabled to statusBarMode leaves multiple HomeFragment checks using stale old preference

When the user selects "None" or "Android Status Bar" via the new statusBarMode preference, several internal checks in HomeFragment still read the old prefs.statusBarEnabled boolean. Since the statusBarMode setter only writes to the STATUS_BAR_MODE key and never updates STATUS_BAR_ENABLED, the old statusBarEnabled getter returns its default value of true.

Affected locations and impact

The following locations in HomeFragment.kt still use the old prefs.statusBarEnabled:

  1. Line 346 (updateNotificationDot): val show = hasNotifications && prefs.statusBarEnabled && prefs.showStatusBarNotificationIndicator — notification dots will still be shown/processed even when the Luma status bar is set to "None" or "Android Status Bar", since statusBarEnabled returns true.

  2. Line 498 (startClock): if (prefs.statusBarEnabled && prefs.timeEnabled) — the clock will keep updating even when the status bar is hidden.

  3. Line 563 (startBatteryMonitor): if (!prefs.statusBarEnabled || ...) — battery monitoring will continue running unnecessarily.

  4. Line 629 (startConnectivityMonitors): if (!prefs.statusBarEnabled) — connectivity monitors will keep running.

Additionally, app/src/main/java/app/luma/ui/AppCountFragment.kt:51 uses prefs.statusBarEnabled to decide whether to show a hint message.

All these should be checking prefs.statusBarMode == Prefs.StatusBarMode.Enabled instead of prefs.statusBarEnabled.

Impact: When a user selects "None" or "Android Status Bar" mode, the Luma status bar view is correctly hidden (line 132), but all the internal monitors (clock, battery, connectivity, notification dot) continue running as if the status bar is enabled, wasting resources and potentially causing visual glitches if the notification dot logic tries to manipulate views inside the hidden status bar.

Prompt for agents
In app/src/main/java/app/luma/ui/HomeFragment.kt, replace all remaining usages of prefs.statusBarEnabled with the equivalent check using the new statusBarMode preference:

1. Line 346: Change `prefs.statusBarEnabled` to `prefs.statusBarMode == Prefs.StatusBarMode.Enabled`
2. Line 498: Change `prefs.statusBarEnabled` to `prefs.statusBarMode == Prefs.StatusBarMode.Enabled`
3. Line 563: Change `!prefs.statusBarEnabled` to `prefs.statusBarMode != Prefs.StatusBarMode.Enabled`
4. Line 629: Change `!prefs.statusBarEnabled` to `prefs.statusBarMode != Prefs.StatusBarMode.Enabled`

Also in app/src/main/java/app/luma/ui/AppCountFragment.kt line 51: Change `prefs.statusBarEnabled` to `prefs.statusBarMode == Prefs.StatusBarMode.Enabled`

Consider whether the old statusBarEnabled property in Prefs.kt (lines 473-475) should be removed entirely or kept only for migration purposes.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Originally posted by @devin-ai-integration[bot] in #28 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions