mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Refactoring
This commit is contained in:
@@ -97,7 +97,7 @@ public class EntityAccount implements Serializable {
|
||||
return "imap" + (starttls ? "" : "s");
|
||||
}
|
||||
|
||||
static String getNotificationChannelName(long account) {
|
||||
static String getNotificationChannelId(long account) {
|
||||
return "notification" + (account == 0 ? "" : "." + account);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class EntityAccount implements Serializable {
|
||||
void createNotificationChannel(Context context) {
|
||||
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
getNotificationChannelName(id), name,
|
||||
getNotificationChannelId(id), name,
|
||||
NotificationManager.IMPORTANCE_HIGH);
|
||||
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
||||
nm.createNotificationChannel(channel);
|
||||
@@ -114,7 +114,7 @@ public class EntityAccount implements Serializable {
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
void deleteNotificationChannel(Context context) {
|
||||
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
nm.deleteNotificationChannel(getNotificationChannelName(id));
|
||||
nm.deleteNotificationChannel(getNotificationChannelId(id));
|
||||
}
|
||||
|
||||
public JSONObject toJSON() throws JSONException {
|
||||
|
||||
Reference in New Issue
Block a user