Protected Broadcasts and undocumented limitiations?

by James » Thu, 22 Oct 2009 01:58:10 GMT


Sponsored Links
 I am attempting to receive PACKAGE broadcasts and as far as I can tell
I have all the permissions required, and all the filters needed.  I
have registered a broadcast listener through the manifest file and I
know my package is being deployed to the emulator.  However, I cannot
receive any of these PACKAGE broadcast intents.  I asked this
question, with snippets of my code and configuration at stackoverflow
and the response I received said that Android will not broadcast
certain system intents to listeners registered via the manifest file
and that they need to be registered via the context's registerListener
() interface instead.

That answer, as far as I can tell has no foundation in the security
documentation.  I have also looked through the android OS source and
found that those intents are registered as protected broadcasts, but
the only place that checks if an Intent is a protected broadcast is to
make sure the process sending, not receiving, it is a system process
or it will fail.  This matches the security documentation.  Is there
any truth to the original answer and is there actually this limitation
that you must use registerListener api to receive protected
broadcasts?

  I saw one package from the source in git that actually registers for
the broadcast through the manifest file and never through
registerListener, so I believe there is something else incorrect and
the current explanation is very misleading.

It appears over at stackoverflow people are coming to accept the
answer of additional undocumented restrictions on these protected
broadcasts, I would like it if we could get clarification if it is
misinformation, or a bug, or perhaps real documentation on the matter
if it is intended behavior.

I am coding against he API level 4 with the Google API's.  My original
question and the response that spurred me to post this can be found
here:
 http://stackoverflow.com/questions/1593022/cant-receive-broadcasts-for-package-intents 

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. GPS sample

Hi all,

I an new to Android, and figuring out how to use GPS API withing my app. 

What am I trying to do?
- I need to find out the location of a android mobile say xyz, and its distance 
from me.

Please, any one can point to to a sample/resource that can help me.


SN
http://www.jsptube.com
--~--~---------~--~----~------------~-------~--~----~

2. DexOpt: source file mod time mismatch (39679511 vs 396799d2)

And um...  I don't see how this is going to work.  You can't just run
an android application.  You need to have the rest of the system
going, and it needs to launch the process to have it run.  More than
that, you'd need to have at least the binder driver installed and
running in your desktop kernel, since that is used for almost all of
the IPCs between processes -- without, when you run the .apk, it will
be unable to get any connection at all to anything else and not do
anything.  And even more, Android applications don't even have a
"main" entrypoint, they publish a set of components that the system
loads into their process and manages, so you would need to have that
done as well.

The simulator is really not much of a bases for "running apps natively
on the desktop."  Yes, it compiles things to native code and runs
those, but the environment is -really- different from the actual
android system.  When running as a simulator, EVERYTHING is in a
single process (all system services, all applications, everything) and
there is a little bit of code in places to spawn threads to kind-of
emulate processes.

So you could use the simulator as a way to get versions of things that
are compiled for your desktop system, but there is significant work
ahead of you to actually bring that up and running in some semblance
of an android system.





--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

3. AGTUG: Australian Google Technology Users Group

4. no streets in Maps app.

5. ViewFlipper onFlipListener

6. adb USB gadget driver now available

7. What's wrong in my code ?