@@ -913,11 +913,11 @@ private DfuServiceInitiator init(@Nullable final Uri fileUri,
913
913
}
914
914
915
915
@ RequiresApi (api = Build .VERSION_CODES .O )
916
- public static void createDfuNotificationChannel (@ NonNull final Context context ) {
916
+ public static void createDfuNotificationChannel (@ NonNull final Context context , @ NonNull final String dfu_channel_name , @ NonNull final String dfu_channel_description , boolean showBadge ) {
917
917
final NotificationChannel channel =
918
- new NotificationChannel (DfuBaseService .NOTIFICATION_CHANNEL_DFU , context . getString ( R . string . dfu_channel_name ) , NotificationManager .IMPORTANCE_LOW );
919
- channel .setDescription (context . getString ( R . string . dfu_channel_description ) );
920
- channel .setShowBadge (false );
918
+ new NotificationChannel (DfuBaseService .NOTIFICATION_CHANNEL_DFU , dfu_channel_name , NotificationManager .IMPORTANCE_LOW );
919
+ channel .setDescription (dfu_channel_description );
920
+ channel .setShowBadge (showBadge );
921
921
channel .setLockscreenVisibility (Notification .VISIBILITY_PUBLIC );
922
922
923
923
final NotificationManager notificationManager =
@@ -926,4 +926,9 @@ public static void createDfuNotificationChannel(@NonNull final Context context)
926
926
notificationManager .createNotificationChannel (channel );
927
927
}
928
928
}
929
+
930
+ @ RequiresApi (api = Build .VERSION_CODES .O )
931
+ public static void createDfuNotificationChannel (@ NonNull final Context context ) {
932
+ createDfuNotificationChannel (context , context .getString (R .string .dfu_channel_name ), context .getString (R .string .dfu_channel_description ), false )
933
+ }
929
934
}
0 commit comments