Saturday, March 3, 2012

PHONE_STATE broadcast and 4.0.3

Anybody out there who has experience with android.intent.action.PHONE_STATE broadcasts and 4.0.3? I wrote this simple application that is just a receiver for this broadcast intent. It works beautifully on 2.2 but does not capture any broadcasts on a Nexus S with the official Google 4.0.3 firmware. The manifest has the permission (XML mangling because of the blog engine):

    [uses-permission android:name="android.permission.READ_PHONE_STATE"/]

and the receiver:

       [receiver android:name=".PhoneIntentReceiver"
                [action android:name="android.intent.action.PHONE_STATE" /]

Is this a 4.0.3 bug?


Anonymous said...

I don't have experience with this particular intent, but on ICS you won't receive broadcasts until your app is started manually at least once.


Gabor Paller said...

Thanks, nfl, that was the reason. It seems for me that autostarting services is now pretty much impossible.

Reylan | Labor Posters said...

Is it because that ICS are not stable yet in some devices.