1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

Device connection: added Scan service channel

This commit is contained in:
Daniel Dakhno 2024-02-26 00:15:34 +01:00
parent 281a087550
commit b1b5eada68
3 changed files with 9 additions and 1 deletions

View File

@ -180,7 +180,7 @@ public class BLEScanService extends Service {
private Notification createNotification(String content, int icon){ private Notification createNotification(String content, int icon){
return new NotificationCompat return new NotificationCompat
.Builder(this, GB.NOTIFICATION_CHANNEL_ID) .Builder(this, GB.NOTIFICATION_CHANNEL_ID_SCAN_SERVICE)
.setContentTitle(getString(R.string.scan_service_title)) .setContentTitle(getString(R.string.scan_service_title))
.setContentText(content) .setContentText(content)
.setSmallIcon(icon) .setSmallIcon(icon)

View File

@ -67,6 +67,7 @@ public class GB {
public static final String NOTIFICATION_CHANNEL_ID = "gadgetbridge"; public static final String NOTIFICATION_CHANNEL_ID = "gadgetbridge";
public static final String NOTIFICATION_CHANNEL_ID_CONNECTION_STATUS = "gadgetbridge connection status"; public static final String NOTIFICATION_CHANNEL_ID_CONNECTION_STATUS = "gadgetbridge connection status";
public static final String NOTIFICATION_CHANNEL_ID_SCAN_SERVICE = "gadgetbridge_scan_service";
public static final String NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID = "gadgetbridge_high_priority"; public static final String NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID = "gadgetbridge_high_priority";
public static final String NOTIFICATION_CHANNEL_ID_TRANSFER = "gadgetbridge transfer"; public static final String NOTIFICATION_CHANNEL_ID_TRANSFER = "gadgetbridge transfer";
public static final String NOTIFICATION_CHANNEL_ID_LOW_BATTERY = "low_battery"; public static final String NOTIFICATION_CHANNEL_ID_LOW_BATTERY = "low_battery";
@ -121,6 +122,12 @@ public class GB {
NotificationManager.IMPORTANCE_LOW); NotificationManager.IMPORTANCE_LOW);
notificationManager.createNotificationChannel(channelConnwectionStatus); notificationManager.createNotificationChannel(channelConnwectionStatus);
NotificationChannel channelScanService = new NotificationChannel(
NOTIFICATION_CHANNEL_ID_SCAN_SERVICE,
context.getString(R.string.notification_channel_scan_service_name),
NotificationManager.IMPORTANCE_LOW);
notificationManager.createNotificationChannel(channelScanService);
NotificationChannel channelHighPriority = new NotificationChannel( NotificationChannel channelHighPriority = new NotificationChannel(
NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID, NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID,
context.getString(R.string.notification_channel_high_priority_name), context.getString(R.string.notification_channel_high_priority_name),

View File

@ -2695,4 +2695,5 @@
<string name="scan_scanning_single_device">Scanning 1 device</string> <string name="scan_scanning_single_device">Scanning 1 device</string>
<string name="scan_scanning_multiple_devices">Scanning %d devices</string> <string name="scan_scanning_multiple_devices">Scanning %d devices</string>
<string name="scan_service_title">Scan service</string> <string name="scan_service_title">Scan service</string>
<string name="notification_channel_scan_service_name">Scan service</string>
</resources> </resources>