Skip to content

#2163 feat: add ringer mode constraints (Ring, Vibrate, Silent)#2177

Open
keymapper-ai wants to merge 1 commit into
developfrom
claude/issue-2163-ringer-mode-constraints
Open

#2163 feat: add ringer mode constraints (Ring, Vibrate, Silent)#2177
keymapper-ai wants to merge 1 commit into
developfrom
claude/issue-2163-ringer-mode-constraints

Conversation

@keymapper-ai

Copy link
Copy Markdown
Collaborator

Summary

Closes #2163.

Adds three new constraints in the Phone category that check the device's current ringer mode:

  • Ringer mode: Ring — satisfied when ringer mode is normal/ring
  • Ringer mode: Vibrate — satisfied when ringer mode is vibrate
  • Ringer mode: Silent — satisfied when ringer mode is silent

Changes

  • ConstraintId — added RINGER_MODE_NORMAL, RINGER_MODE_VIBRATE, RINGER_MODE_SILENT
  • ConstraintData — added three new data object variants with entity mapper round-trip
  • ConstraintEntity — added string constants for the three new types
  • ConstraintUtils — mapped new IDs to Phone category, icons (Notifications, Vibration, NotificationsOff), and title string IDs
  • ConstraintUiHelper — added display titles for the three new constraints
  • ConstraintDependency — added RINGER_MODE dependency type
  • VolumeAdapter — added ringerModeFlow: Flow<RingerMode> to interface
  • AndroidVolumeAdapter — implemented ringerModeFlow via BroadcastReceiver for AudioManager.RINGER_MODE_CHANGED_ACTION (same pattern as AndroidPowerAdapter)
  • LazyConstraintSnapshot — injected VolumeAdapter, added lazy ringerMode field, added three isSatisfied cases
  • DetectConstraintsUseCase — injected VolumeAdapter, passed to snapshot, handled RINGER_MODE dependency
  • TestConstraintSnapshot — added ringerMode: RingerMode = RingerMode.NORMAL field and three test cases
  • strings.xml — added constraint_ringer_mode_normal/vibrate/silent
  • CHANGELOG.md — added entry under 4.2.0

No special permissions are required to read the ringer mode.


Generated by Claude Code

Add three new constraints to check the current ringer mode: Ring, Vibrate,
and Silent. These appear in the Phone category of the constraint picker.

- Add RINGER_MODE_NORMAL, RINGER_MODE_VIBRATE, RINGER_MODE_SILENT to ConstraintId
- Add corresponding ConstraintData sealed objects and entity mapping
- Add ringerModeFlow to VolumeAdapter, implemented via BroadcastReceiver for
  AudioManager.RINGER_MODE_CHANGED_ACTION in AndroidVolumeAdapter
- Wire VolumeAdapter into LazyConstraintSnapshot and DetectConstraintsUseCase
- Add RINGER_MODE to ConstraintDependency
- Add UI strings, icons, and titles
- Update TestConstraintSnapshot with ringerMode field
@keymapper-ai keymapper-ai requested a review from sds100 June 27, 2026 00:27
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.

ringer mode contraints

2 participants