Repository navigation
Conversation
… to DIY States now run their exit actions when disabled or deleted while active, through a shared StateEntries helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
Adds new DIY state and trigger options for sound:
They sit in a new Sound category in the editor. The DND on/off triggers already existed and are unchanged. No new permissions: reading the interruption filter and the ringer mode needs none.
These states also close properly: saving one that's already true runs its entry actions straight away, and disabling or deleting one that's active runs its exit actions once. That logic lives in a small shared helper,
StateEntries, which keeps a copy of each automation as it was when it entered, so an edited or deleted automation still runs its own exit actions. It's pure Kotlin and unit tested. Existing states aren't changed in this PR.How: a new
SoundModulelistens toRINGER_MODE_CHANGED_ACTION; the DND state usesNotificationModule's existingACTION_INTERRUPTION_FILTER_CHANGEDreceiver. Both are push-only, with no polling or timers. The mode sheet reusesSoundModeSettingsSheet(new optionaltitleandshowInfoparameters, so existing callers are unchanged), andAction.SoundModeTypenow carries its icon so it's mapped in one place.Type of change
UI changes
The state picker with the new Sound category (Do Not Disturb, Sound mode).
Choosing the mode for the Sound mode state.
The automation list with a DND state, a Vibrate state and a "changes to Silent" trigger.
Checklist
develop(notmain)../gradlew assembleDebug../gradlew testDebugUnitTest.SettingsRepositoryfor keys and getter/setter methods. (No new preferences.)FeatureRegistry.ktfor search indexing. (No new settings; DIY options aren't indexed.)ui/core/(RoundedCardContainer,IconToggleItem, etc.).res/values/strings.xmland drawables use rounded variants (R.drawable.rounded_*).🤖 Generated with Claude Code