• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps application communication and permissions

AndreMu

Lurker
Apr 29, 2010
4
0
Greetings.
Ive recently started dabbling with android application development, and permission enforcement confuses me a bit, so I was hoping someone could elaborate on the following:

Im working on application communication, and if I run two applications with different permissions, and app#1 starts a service belonging to app#2 by sending an intent, with the startService method, should it not generate a SecurityException?

I am asking because I was expecting an error but did not get any, so I am wondering why.

The permissions are set in the manifest like so:
Code:
<manifest>
   <application>
       <....>
   </application>
   <uses-permission...>
</manifest>

If I nest the <uses-permission> statement in the <service> tag, I get the expected SecurityException, but that is not the case, when the <uses-permission> tag is placed outside of the application, as done in the example above.

So what is the difference? Ive been searching the forums and the official site, and havent been able to find an answer for this one.
Shouldn't the service also inherit the permissions required by the application?

- I am not sure if this is of any importance, but I am using an emulated android version 2.1 phone.

Hope someone can point me in the right direction on this one :)
Thanks for your time,
Andr
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones