Loading src/com/android/calendar/alerts/AlertService.java +13 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.text.format.DateUtils; import android.text.format.Time; import android.util.Log; import android.support.v4.app.NotificationCompat; import com.android.calendar.GeneralPreferences; import com.android.calendar.OtherPreferences; import com.android.calendar.Utils; Loading @@ -64,6 +65,7 @@ import foundation.e.calendar.R; */ public class AlertService extends Service { public static final String FOREGROUND_CHANNEL_ID = "foreground_channel_01"; public static final String ALERT_CHANNEL_ID = "alert_channel_01";// The id of the channel. // Hard limit to the number of notifications displayed. Loading Loading @@ -172,7 +174,7 @@ public class AlertService extends Service { } if (!prefs.getBoolean(GeneralPreferences.KEY_ALERTS, true)) { if (!prefs.getBoolean(GeneralPreferences.KEY_ALERTS, true) && !Utils.isOreoOrLater()) { if (DEBUG) { Log.d(TAG, "alert preference is OFF"); } Loading Loading @@ -980,6 +982,16 @@ public class AlertService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { if (Utils.isOreoOrLater()) { Notification notification = new NotificationCompat.Builder(this, ALERT_CHANNEL_ID) .setContentTitle("Event notifications") .setSmallIcon(R.drawable.stat_notify_calendar) .setShowWhen(false) .build(); startForeground(1337, notification); } Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; msg.obj = intent.getExtras(); Loading Loading
src/com/android/calendar/alerts/AlertService.java +13 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.text.format.DateUtils; import android.text.format.Time; import android.util.Log; import android.support.v4.app.NotificationCompat; import com.android.calendar.GeneralPreferences; import com.android.calendar.OtherPreferences; import com.android.calendar.Utils; Loading @@ -64,6 +65,7 @@ import foundation.e.calendar.R; */ public class AlertService extends Service { public static final String FOREGROUND_CHANNEL_ID = "foreground_channel_01"; public static final String ALERT_CHANNEL_ID = "alert_channel_01";// The id of the channel. // Hard limit to the number of notifications displayed. Loading Loading @@ -172,7 +174,7 @@ public class AlertService extends Service { } if (!prefs.getBoolean(GeneralPreferences.KEY_ALERTS, true)) { if (!prefs.getBoolean(GeneralPreferences.KEY_ALERTS, true) && !Utils.isOreoOrLater()) { if (DEBUG) { Log.d(TAG, "alert preference is OFF"); } Loading Loading @@ -980,6 +982,16 @@ public class AlertService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { if (Utils.isOreoOrLater()) { Notification notification = new NotificationCompat.Builder(this, ALERT_CHANNEL_ID) .setContentTitle("Event notifications") .setSmallIcon(R.drawable.stat_notify_calendar) .setShowWhen(false) .build(); startForeground(1337, notification); } Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; msg.obj = intent.getExtras(); Loading