Commit 6836130f authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

Added overloaded method call for progress notification so it accepts foreign context

parent 72489387
...@@ -7,10 +7,6 @@ import android.content.Context; ...@@ -7,10 +7,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.app.TaskStackBuilder;
import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.App;
import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.ClassMap;
import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.Const;
...@@ -20,6 +16,10 @@ import com.topjohnwu.magisk.model.receiver.GeneralReceiver; ...@@ -20,6 +16,10 @@ import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
import com.topjohnwu.magisk.ui.SplashActivity; import com.topjohnwu.magisk.ui.SplashActivity;
import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.magisk.utils.Utils;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.app.TaskStackBuilder;
public class Notifications { public class Notifications {
public static NotificationManagerCompat mgr = NotificationManagerCompat.from(App.self); public static NotificationManagerCompat mgr = NotificationManagerCompat.from(App.self);
...@@ -101,9 +101,12 @@ public class Notifications { ...@@ -101,9 +101,12 @@ public class Notifications {
mgr.notify(Const.ID.DTBO_NOTIFICATION_ID, builder.build()); mgr.notify(Const.ID.DTBO_NOTIFICATION_ID, builder.build());
} }
public static NotificationCompat.Builder progress(String title) { public static NotificationCompat.Builder progress(CharSequence title) {
App app = App.self; return progress(App.self, title);
NotificationCompat.Builder builder = new NotificationCompat.Builder(app, Const.ID.PROGRESS_NOTIFICATION_CHANNEL); }
public static NotificationCompat.Builder progress(Context context, CharSequence title) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Const.ID.PROGRESS_NOTIFICATION_CHANNEL);
builder.setPriority(NotificationCompat.PRIORITY_LOW) builder.setPriority(NotificationCompat.PRIORITY_LOW)
.setSmallIcon(android.R.drawable.stat_sys_download) .setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle(title) .setContentTitle(title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment