* feat: Improve notification behavior
- Changes low battery notifications to be non-cancelable
- Cancel low battery notifications when battery level is no longer low.
- Add notification groups and improve notification settings.
- Add vibration to low battery notifications.
* Improve low battery notification
Add battery level progress bar to the low battery notification.
* Add initial implementation of low battery notifications for locally-connected and favorite nodes
* Hopefully make detekt happy
* detekt pls.
* Deduplicate some of the code
* detekt'd
* feat: Show alert notifications and override silent mode
This commit adds support for showing alert notifications with high priority and the ability to override silent mode to ensure they are delivered to the user.
The changes include:
- Adding `showAlertNotification` function which overrides silent mode and configures a custom volume, shows a notification with high priority.
- Creating a new notification channel for alerts.
- Adding the alert app port number to the list of remembered data types.
- Modifying `rememberDataPacket` to check for alert app messages and show alert notification.
* Add notification policy access permission and DND override for alerts
This commit adds the `ACCESS_NOTIFICATION_POLICY` permission to the manifest and requests this permission from the user. It also adds a check for notification policy access in the MainActivity, and if it's not granted, shows a rationale dialog.
Additionally, the commit adds a notification override to the `showAlertNotification` function in `MeshServiceNotifications` to temporarily disable DND for alert notifications and restore the original ringer settings afterwards.
* Refactor: Enhance Android Notification and DND Handling
- **Notification Channel Improvements:**
- Added `notificationLightColor` for better customization.
- Set `enableLights` and `enableVibration` in the alert channel.
- Use `alert.mp3` sound for alert channel.
- **DND Permission Request:**
- Introduced a new permission request flow for Do Not Disturb (DND) access.
- Show a rationale dialog before requesting permission.
- Persist if rationale was shown to avoid re-prompting.
- Added a `notificationPolicyAccessLauncher` to handle the permission request result.
- **Critical Alert Text**
- Added critical alert text in strings.
- Used critical alert text if the alert message is empty.
- **Other Changes**
- Removed unused imports and constants.
- Updated snackbar to support action.
* Refactor alert notification logic
- Change `notificationLightColor` to be lazy initialized.
- Update alert notification to use `CATEGORY_ALARM`.
- Use `dataPacket.alert` instead of `dataPacket.text` for alert content.
- Add `alert` property to `DataPacket` to handle alert messages.
* Set notification light color back to blue.
* Request notification permissions on grant
The app now checks for notification policy access after notification permissions are granted.
* make detekt happy
* updates dnd dialog text
* Refactor notification channel creation and critical alerts
- Initialize notification channels on service creation.
- Remove `ACCESS_NOTIFICATION_POLICY` permission.
- Modify the logic for requesting "Do Not Disturb" override permission to align with channel settings.
- Add new string resources for Alerts Channel Settings.
- Update wording for critical alert DND override.
- Update DND override request flow.
- Create notification channels on the service creation using `initChannels`.
- Adjust logic to check for "Do Not Disturb" override permission to align with notification channel settings.
- Ensure notification channels are created only if they do not already exist.
* refactor: Update DnD dialog with instructions for Samsung
- Renamed "Alerts Channel Settings" to "Channel Settings".
- Added Samsung-specific instructions and a link to Samsung's support page for Do Not Disturb mode in the alerts dialog.
- Updated the dialog to display Samsung-specific instructions when on a Samsung device.
* Refactor critical alerts instructions
- Updated the critical alerts instructions to include a link to Samsung's support page directly within the alert dialog.
- Removed the separate "Samsung Instructions" string and incorporated the information into the main instruction text, improving clarity and reducing redundancy.
- Made improvements to the UI.
* Show unique notifications per contact
Instead of a single notification for all messages, each contact now has its own, unique notification. This uses the `NotificationCompat.MessagingStyle` and the contact's name to create distinct notifications, enhancing message organization.
* feat: Add notification tap action to open contacts tab
This is done by:
- Adding an intent extra to the notification with the contact key for future use to navigate to the message thread.
- Adding a new action to the MainActivity to handle the intent.
- Updating the message notification to include the intent.
* Open message notification to the correct conversation
Adds an extra to the message notification intent to open the correct conversation. This ensures that when a user taps on a message notification, they are taken to the conversation with the sender of that message.
Adds a chronometer to the service notification, counting down to the next stats update.
Also adds timestamps to the service notification, message notification, and new node seen notification.
* Add notification for new node seen
This change adds a new notification that is displayed when a new node is seen.
The notification includes the node's
name.
It also updates the message notification to include the node name.
* Show individual notification for each new node
* Add new nodes notifications
Adds a new notification channel for new nodes seen.
This channel is set to high importance with sound and light.
This commit adds the local device stats to the service notification. This information includes the number of online and total nodes, as well as other local stats. It also updates the notification summary and adds local stats telemetry handling.
- moved MeshService start-related code to `MeshServiceStarter`
- moved `LocationCallback` to `MeshServiceLocationCallback`
- coroutine scope is now handled in `MeshService` positio ncallback.
- refactored `onLocationResult()` to be easier to read
- created `MeshServiceNotifications` for creating and updating of notifications
- moved `SavedSettings` to `MeshServiceSettingsData`