InsightAlertservice: handle nullable intent.

This commit is contained in:
Johannes Mockenhaupt 2020-04-15 00:02:50 +02:00
parent 98af8531f0
commit e17d10f258
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -104,8 +104,10 @@ public class InsightAlertService extends Service implements InsightConnectionSer
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if ("mute".equals(intent.getStringExtra("command"))) {
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
if (intent == null) {
// service is being restarted
} else if ("mute".equals(intent.getStringExtra("command"))) {
mute();
} else if ("confirm".equals(intent.getStringExtra("command"))) {
dismissNotification();