Skip to content

Commit

Permalink
revert changes to TextEditorActivity (changes included in: #3907)
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Oct 24, 2023
1 parent 6783e4d commit cc204b0
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
import com.amaze.filemanager.utils.NetworkUtil;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;

import androidx.annotation.StringRes;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.preference.PreferenceManager;

/**
Expand Down Expand Up @@ -96,9 +96,7 @@ public static Notification startNotification(Context context, boolean noStopButt
}

public static void updateNotification(Context context, boolean noStopButton) {
String notificationService = Context.NOTIFICATION_SERVICE;
NotificationManager notificationManager =
(NotificationManager) context.getSystemService(notificationService);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);

SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
int port = sharedPreferences.getInt(FtpService.PORT_PREFERENCE_KEY, FtpService.DEFAULT_PORT);
Expand Down Expand Up @@ -129,8 +127,6 @@ public static void updateNotification(Context context, boolean noStopButton) {
}

private static void removeNotification(Context context) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager nm = (NotificationManager) context.getSystemService(ns);
nm.cancelAll();
NotificationManagerCompat.from(context).cancelAll();
}
}

0 comments on commit cc204b0

Please sign in to comment.