Loading src/com/android/calendar/alerts/AlertReceiver.java +7 −2 Original line number Diff line number Diff line Loading @@ -128,12 +128,17 @@ public class AlertReceiver extends BroadcastReceiver { PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mStartingService = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "StartingAlertService"); "Etar:StartingAlertService"); mStartingService.setReferenceCounted(false); } mStartingService.acquire(); if (Utils.isOreoOrLater()) { context.startForegroundService(intent); } else { context.startService(intent); } } } /** Loading src/com/android/calendar/alerts/AlertService.java +12 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.os.Process; import android.provider.CalendarContract; import android.provider.CalendarContract.Attendees; import android.provider.CalendarContract.CalendarAlerts; import android.support.v4.app.NotificationCompat; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.text.format.DateUtils; Loading Loading @@ -172,7 +173,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 +981,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/AlertReceiver.java +7 −2 Original line number Diff line number Diff line Loading @@ -128,12 +128,17 @@ public class AlertReceiver extends BroadcastReceiver { PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mStartingService = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "StartingAlertService"); "Etar:StartingAlertService"); mStartingService.setReferenceCounted(false); } mStartingService.acquire(); if (Utils.isOreoOrLater()) { context.startForegroundService(intent); } else { context.startService(intent); } } } /** Loading
src/com/android/calendar/alerts/AlertService.java +12 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.os.Process; import android.provider.CalendarContract; import android.provider.CalendarContract.Attendees; import android.provider.CalendarContract.CalendarAlerts; import android.support.v4.app.NotificationCompat; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.text.format.DateUtils; Loading Loading @@ -172,7 +173,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 +981,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