-
Notifications
You must be signed in to change notification settings - Fork 56
Respect vibration patterns from Notification Channel and Tasker #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect vibration patterns from Notification Channel and Tasker #73
Conversation
...idMain/kotlin/io/rebble/libpebblecommon/notification/processor/BasicNotificationProcessor.kt
Outdated
Show resolved
Hide resolved
...c/androidMain/kotlin/io/rebble/libpebblecommon/notification/LibPebbleNotificationListener.kt
Outdated
Show resolved
Hide resolved
...idMain/kotlin/io/rebble/libpebblecommon/notification/processor/BasicNotificationProcessor.kt
Show resolved
Hide resolved
| val id: String, | ||
| val name: String, | ||
| val muteState: MuteState, | ||
| val vibrationPattern: List<UInt>? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work unless you bump the database version and add a migration to create the column - see e.g. https://github.com/coredevices/CoreApp/commit/d1e34ef7116aa69170ff47ba9561a144a8bd9873#diff-4bbbd39fe1ff5faa4ceef66355eb272f66db7ac0e0e462a95647c1b6c4272ea7 (otherwiswe it will crash, unless you're running a fresh install of the app)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. It was crashing before I added the default value, but it was working fine for me after I set the default value. Maybe it just ignores that column in the db right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad - got confused with db fields vs this object which is serialized into a db field (so adding the default value fixing it makes sense)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. So I think I can just leave it, right? The vibration pattern just won't get added to the db as a column?
Android doesn't really do per-notification vibration patterns anymore as far as I can tell. This PR pulls the vibration pattern from the Notification Channel, and from the extra field in Tasker's AutoNotification plugin. The Notification Channel code adds a 0 at the beginning of the pattern to match Android's vibration pattern syntax, and the Autonotification code doesn't, to match with Pebble's vibration pattern syntax. This replaces #71.