Commit graph

31 commits

Author SHA1 Message Date
James Rich
6153cfdab1
Refactor: Use FLAG_ACTIVITY_SINGLE_TOP for MainActivity intents (#2022) 2025-06-04 19:20:30 +00:00
James Rich
4d6eb3dfe9
feat: Allow direct message replies from notifications (#1994)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-31 20:48:24 -05:00
James Rich
8d231ff125
refactor: Update notification and service handling (#1993) 2025-05-31 20:02:23 +00:00
James Rich
8cde47bdf9
refactor: migrate to Compose navigation (#1835)
Co-authored-by: andrekir <andrekir@pm.me>
2025-05-15 08:05:30 -05:00
James Rich
e9d6916529
fix: remove notification grouping (#1735) 2025-03-31 12:16:22 -05:00
James Rich
5846bf5ee4
feat: Improve (battery) notification behavior (#1661)
* 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.
2025-03-12 05:02:14 -05:00
Ken Piper
c7c29cb1c1
feat: Initial implementation of low battery notifications for nodes (#1653)
* 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
2025-03-08 04:52:30 -06:00
James Rich
d78bea2365
feat: Show ALERT_APP notifications and override DND (#1515)
* 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.
2025-03-05 07:28:52 -06:00
Ken Piper
b316e066ad
fix: Add the "When" to new message notifications (#1628) 2025-03-02 06:11:33 -06:00
andrekir
13b615a470 chore: update license header 2025-01-02 07:00:51 -03:00
andrekir
44d195a4a5 refactor: Messages navigation to single contactKey argument 2024-11-28 08:45:44 -03:00
andrekir
1c42bd262f fix: notification intents with immutable flags 2024-11-28 08:41:58 -03:00
andrekir
6230f13bff refactor: add custom formatting to LocalStats fields 2024-11-26 09:00:44 -03:00
andrekir
1219d3037e chore: add GPL-3.0 license headers to source files 2024-11-26 08:54:18 -03:00
James Rich
80e915a36c
feat: show unique messaging notifications per contact (#1381)
* 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.
2024-11-04 19:05:39 -03:00
andrekir
7289896956 refactor: remove largeIcon from notifications 2024-10-22 12:13:34 -03:00
James Rich
b73c53bc11
feat: Add Chronometer and Timestamp to Service Notification (#1327)
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.
2024-10-18 12:46:56 -03:00
James Rich
f6ec3e8bab
feat: Add notification for new node seen (#1316)
* 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.
2024-10-15 06:07:22 -03:00
James Rich
38942ec557
Add local device stats to the service notification (#1307)
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.
2024-10-13 08:10:28 -03:00
andrekir
e72b046c53 refactor: convert gpsString to Position extension 2023-09-04 18:40:21 -03:00
Andre K
271124dc9c
refactor: implement CompatExtensions (#641)
updates deprecated methods, classes, and flags introduced in Android SDK 33, while ensuring compatibility with previous Android versions
2023-05-30 18:30:46 -03:00
andrekir
c9bff2b942 fix: remove unnecessary SDK_INT < 21 check 2023-03-19 07:55:19 -03:00
andrekir
00de511907 update targetSdkVersion to 31 2022-11-04 18:31:18 -03:00
Kevin Hester
5b653d29f8 reformat per coding conventions 2021-03-29 20:33:06 +08:00
Kevin Hester
d290555aba fix notification to include text message even when not expanded 2021-02-08 13:25:29 +08:00
Vadim Furman
e2c8ca2fb2 Separate notification channel for messages 2021-02-07 17:38:54 -08:00
Kevin Hester
9cb9e93dd2 never use app specific icons when <= android 5.1.1 2021-02-06 09:29:11 +08:00
Kevin Hester
2c3b73ae88 fix(?) for cyanogen problem with custom statusbar icons 2021-02-05 09:31:25 +08:00
Kevin Hester
55fd7c7330 make a guaranteed non vector version of icon for older androids 2021-02-04 08:20:43 +08:00
Kevin Hester
0693d7786d use new icons from @thepoweroftwo 2021-01-30 14:59:28 +08:00
Ken Van Hoeylandt
3610f0b53e refactored MeshService
- 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`
2020-10-01 22:20:19 +02:00