From: Ken Shirriff Date: Sun, 27 Sep 2009 22:21:09 +0000 (-0700) Subject: Use onStartCommand() in AlertService. X-Git-Tag: android-x86-2.2~107^2~40^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c1dc950c9b5756937a1df44463cc09fdf0649420;p=android-x86%2Fpackages-apps-Calendar.git Use onStartCommand() in AlertService. This service is supposed to handle an intent, so it uses START_REDELIVER_INTENT to make sure the intent is handled. --- diff --git a/src/com/android/calendar/AlertService.java b/src/com/android/calendar/AlertService.java index 558a8f6..6550694 100644 --- a/src/com/android/calendar/AlertService.java +++ b/src/com/android/calendar/AlertService.java @@ -427,11 +427,14 @@ public class AlertService extends Service { } @Override - public void onStart(Intent intent, int startId) { - Message msg = mServiceHandler.obtainMessage(); - msg.arg1 = startId; - msg.obj = intent.getExtras(); - mServiceHandler.sendMessage(msg); + public int onStartCommand(Intent intent, int flags, int startId) { + if (intent != null) { + Message msg = mServiceHandler.obtainMessage(); + msg.arg1 = startId; + msg.obj = intent.getExtras(); + mServiceHandler.sendMessage(msg); + } + return START_REDELIVER_INTENT; } @Override