#2163 feat: add ringer mode constraints (Ring, Vibrate, Silent)#2177
Open
keymapper-ai wants to merge 1 commit into
Open
#2163 feat: add ringer mode constraints (Ring, Vibrate, Silent)#2177keymapper-ai wants to merge 1 commit into
keymapper-ai wants to merge 1 commit into
Conversation
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
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.
Summary
Closes #2163.
Adds three new constraints in the Phone category that check the device's current ringer mode:
Changes
ConstraintId— addedRINGER_MODE_NORMAL,RINGER_MODE_VIBRATE,RINGER_MODE_SILENTConstraintData— added three newdata objectvariants with entity mapper round-tripConstraintEntity— added string constants for the three new typesConstraintUtils— mapped new IDs to Phone category, icons (Notifications,Vibration,NotificationsOff), and title string IDsConstraintUiHelper— added display titles for the three new constraintsConstraintDependency— addedRINGER_MODEdependency typeVolumeAdapter— addedringerModeFlow: Flow<RingerMode>to interfaceAndroidVolumeAdapter— implementedringerModeFlowviaBroadcastReceiverforAudioManager.RINGER_MODE_CHANGED_ACTION(same pattern asAndroidPowerAdapter)LazyConstraintSnapshot— injectedVolumeAdapter, added lazyringerModefield, added threeisSatisfiedcasesDetectConstraintsUseCase— injectedVolumeAdapter, passed to snapshot, handledRINGER_MODEdependencyTestConstraintSnapshot— addedringerMode: RingerMode = RingerMode.NORMALfield and three test casesstrings.xml— addedconstraint_ringer_mode_normal/vibrate/silentCHANGELOG.md— added entry under 4.2.0No special permissions are required to read the ringer mode.
Generated by Claude Code