Skip to content

Add full system stream controls (call/ring/alarm/notification) and ring-mode toggles to popup + main UI#52

Merged
yume-chan merged 22 commits into
mainfrom
copilot/add-call-volume-slider
May 17, 2026
Merged

Add full system stream controls (call/ring/alarm/notification) and ring-mode toggles to popup + main UI#52
yume-chan merged 22 commits into
mainfrom
copilot/add-call-volume-slider

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

This issue reports missing call-volume visibility/control during calls and requests consolidating system controls into the app UI. This PR adds a unified system-controls panel to both popup and main screens, expands stream coverage, and persists per-slider visibility preferences.

  • Unified system controls panel

    • Added SystemVolumePanel composable and reused it in:
      • Accessibility popup (Service)
      • Main app interface (MainActivity)
    • Centralizes system stream sliders and ring-mode toggles.
  • Popup behavior and stream ordering

    • Popup tracks audio mode using AudioManager.addOnModeChangedListener and conditionally shows Call volume when in MODE_IN_CALL / MODE_IN_COMMUNICATION.
    • Slider order in popup is:
      • During call: Call, Media, Ring, Alarm, Notification
      • Otherwise: Media, Ring, Alarm, Notification
    • Renamed music label to Media.
    • Popup does not show per-slider visibility toggle buttons.
  • Main interface stream sliders

    • Main app always renders stream sliders above app list/empty state.
    • Order is fixed to: Media, Ring, Call, Alarm, Notification.
    • Main interface shows per-slider visibility toggle buttons.
  • Per-slider visibility with persistence

    • Replaced single popup visibility flag with a per-slider visibility map (stream IDs) in DataStore.
    • Visibility preferences are configured in main UI and applied when deciding which sliders are shown in popup.
  • Ring slider enhancements

    • Vibrate and Do Not Disturb toggles are shown inline on the Ring slider (before hide/show toggle), so they remain available even if notification slider is not shown.
    • Ring icon updated to Icons.Default.RingVolume.
  • Privileged DND implementation

    • Added NotificationManagerProxy in moe.chensi.volume.system and switched DND updates to binder-proxied setInterruptionFilter.
    • Removed previously added unnecessary manifest permissions for this feature path.
  • Brightness rollback per feedback

    • Removed all brightness-related functionality added in this PR because it was not working:
      • Brightness slider UI
      • Auto-brightness toggle/bias logic
      • DisplayManagerProxy and BrightnessUtils
      • Brightness-related strings and visibility key
    • Kept all other system volume controls intact.
  • UI correctness/build fixes from review

    • StreamSliderTextContent is now RowScope.StreamSliderTextContent (fixes Modifier.weight usage).
    • Stream slider skips redundant writes when old and new integer volume are equal.
    • System sliders now render slider track and option buttons in one row (matching app sliders).
    • Empty-state indicator in app list no longer occupies an entire page height.
  • Localization + version bump

    • Added/updated string resources in:
      • values/strings.xml
      • values-zh-rCN/strings.xml
    • Bumped app version:
      • versionCode 19 -> 20
      • versionName 0.3-beta.15 -> 0.3-beta.16
SystemVolumePanel(
    audioManager = manager.audioManager,
    notificationManagerProxy = manager.notificationManagerProxy,
    showCallVolumeAlways = false,
    applyVisibilityFilter = true,
    allowVisibilityConfig = false,
    isSliderVisible = manager::isSystemSliderVisible,
    onSliderVisibilityChange = manager::setSystemSliderVisible,
    onChange = this@Service.handler::startIdleTimer
)

> [!WARNING]
>
>

Copilot AI and others added 8 commits May 12, 2026 04:23
Agent-Logs-Url: https://github.com/yume-chan/VolumeManager/sessions/0dfe35c2-a621-4609-8a1b-327139ed70d2

Co-authored-by: yume-chan <1330321+yume-chan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/yume-chan/VolumeManager/sessions/0dfe35c2-a621-4609-8a1b-327139ed70d2

Co-authored-by: yume-chan <1330321+yume-chan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/yume-chan/VolumeManager/sessions/0dfe35c2-a621-4609-8a1b-327139ed70d2

Co-authored-by: yume-chan <1330321+yume-chan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add call volume slider and additional volume controls to popup Add full system stream controls (call/ring/alarm/notification), brightness, and notification mode toggles to popup + main UI May 12, 2026
Copilot AI requested a review from yume-chan May 12, 2026 04:29
Comment thread app/src/main/java/moe/chensi/volume/compose/StreamVolumeSlider.kt
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/StreamVolumeSlider.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/Service.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/MainActivity.kt Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add full system stream controls (call/ring/alarm/notification), brightness, and notification mode toggles to popup + main UI Add full system stream controls (call/ring/alarm/notification), brightness, and ring-mode toggles to popup + main UI May 12, 2026
Copilot AI requested a review from yume-chan May 12, 2026 05:54
Comment thread app/src/main/java/moe/chensi/volume/compose/StreamVolumeSlider.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/system/DisplayManagerProxy.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/StreamVolumeSlider.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/Service.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Comment thread app/src/main/java/moe/chensi/volume/compose/SystemVolumePanel.kt Outdated
Copilot AI requested a review from yume-chan May 12, 2026 06:25
@yume-chan
Copy link
Copy Markdown
Owner

@copilot

  1. Resolve build errors by replacing hidden API usages with reflection (using org.joor.Reflect).
  2. Add support for auto brightness (add toggle to brightness slider, and change auto brightness bias when enabled)
  3. displayManagerProxy.registerDisplayListener currently doesn't work. I guess it's caused by it reading ActivityThread.currentPackageName() and get our package name instead of com.android.shell (for Shizuku). Make ToggleableBinderProxy.withEnabled patch ActivityThread.currentPackageName() on enter (and restore on exit)

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 12, 2026

@copilot

  1. Resolve build errors by replacing hidden API usages with reflection (using org.joor.Reflect).
    ...

Implemented in d2cd0f6.

  • Hidden API direct usages in brightness paths were replaced with reflection (org.joor.Reflect) so the build errors are resolved.
  • Added auto-brightness toggle to the brightness slider; when enabled, the slider now adjusts auto-brightness bias.
  • Updated ToggleableBinderProxy.withEnabled to patch/restore ActivityThread current package name during the scoped call.

Screenshot: UI

Copilot AI changed the title Add full system stream controls (call/ring/alarm/notification), brightness, and ring-mode toggles to popup + main UI Add full system stream controls (call/ring/alarm/notification), brightness (manual/auto), and ring-mode toggles to popup + main UI May 12, 2026
@yume-chan
Copy link
Copy Markdown
Owner

@copilot Remove everything related to brightness control added in this PR, it doesn't work. Keep all other volume controls.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 17, 2026

@copilot Remove everything related to brightness control added in this PR, it doesn't work. Keep all other volume controls.

Done in e3b057c. I removed all brightness-related code added in this PR (brightness slider UI, auto-brightness toggle/bias, DisplayManager/Brightness utils/proxy paths, and brightness strings) and kept the other system volume controls unchanged.

Screenshot: UI

Copilot AI changed the title Add full system stream controls (call/ring/alarm/notification), brightness (manual/auto), and ring-mode toggles to popup + main UI Add full system stream controls (call/ring/alarm/notification) and ring-mode toggles to popup + main UI May 17, 2026
@yume-chan yume-chan marked this pull request as ready for review May 17, 2026 15:57
@yume-chan yume-chan merged commit eb0277b into main May 17, 2026
1 check passed
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.

Can't find call volume slider during a call, even with the call app selected.

2 participants