Okay, this did indeed break in 3.3.  The change was from August of last
year.  This is the change that broke it:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=commit;h=5474b0f8603ee66413c3e44600ca46f162f3089e

In particular this change here:

-                if (si.intent == null && N > 1) {
+                if (si.intent == null) {

I'll get this fixed in the next platform update (post-Android 3.0);
unfortunately this code has been out in the source tree for a while, and in
a couple releases now, so we'll need to live with the broken behavior on
those versions.  The service will still have its onCreate() called so you
can do work there.

On Mon, Feb 28, 2011 at 5:45 PM, Jake Basile <[email protected]> wrote:

> Your definition of how START_STICKY works is different from the
> documentation<http://developer.android.com/reference/android/app/Service.html#START_STICKY>
> :
>
> if this service's process is killed while it is started (after returning
> from onStartCommand(Intent, int, 
> int)<http://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent,+int,+int)>),
> then leave it in the started state but don't retain this delivered intent.
> Later the system will try to re-create the service. Because it is in the
> started state, it will guarantee to call onStartCommand(Intent, int, 
> int)<http://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent,+int,+int)>
>  after
> creating the new service instance; if there are not any pending start
> commands to be delivered to the service, it will be called with a null
> intent object, so you must take care to check for this.
>
> This describes exactly what I want to have happen. This is exactly what
> does happen on Android < 2.3. On Android 2.3 (and possibly 3.0), this no
> longer occurs and breaks my app. I know using startForeground works, and I
> use it. That's the kludgy workaround I spoke of, because I don't need to *
> always* be on, I just need to be reliably restarted.
>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to