mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 08:35:37 -04:00
Use silent notification at the default priority
This commit is contained in:
parent
9cebcd2cf4
commit
0252ab1d96
@ -193,7 +193,7 @@ public final class Tools {
|
||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return;
|
||||
NotificationChannel channel = new NotificationChannel(
|
||||
context.getString(R.string.notif_channel_id),
|
||||
context.getString(R.string.notif_channel_name), NotificationManager.IMPORTANCE_HIGH);
|
||||
context.getString(R.string.notif_channel_name), NotificationManager.IMPORTANCE_DEFAULT);
|
||||
NotificationManagerCompat manager = NotificationManagerCompat.from(context);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ public class GameService extends Service {
|
||||
.setContentTitle(getString(R.string.lazy_service_default_title))
|
||||
.setContentText(getString(R.string.notification_game_runs))
|
||||
.addAction(android.R.drawable.ic_menu_close_clear_cancel, getString(R.string.notification_terminate), pendingKillIntent)
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round);
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setNotificationSilent();
|
||||
startForeground(2, notificationBuilder.build());
|
||||
return START_NOT_STICKY; // non-sticky so android wont try restarting the game after the user uses the "Quit" button
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ public class ProgressService extends Service implements TaskCountListener {
|
||||
mNotificationBuilder = new NotificationCompat.Builder(this, "channel_id")
|
||||
.setContentTitle(getString(R.string.lazy_service_default_title))
|
||||
.addAction(android.R.drawable.ic_menu_close_clear_cancel, getString(R.string.notification_terminate), pendingKillIntent)
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round);
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setNotificationSilent();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user