But if I create a public permission in my namespace, and a third party
application wants to use this permission, they would have to use my
namespace for the permission.

Now the user first installs the third party application. Then they'd
better include the definition of my permission with their apk,
otherwise they can later not access my (intent, service, content
provider...) when my apk gets installed.

So, unless I can be sure that the permission is already installed on
the phone, I have to include all permission definitions of third party
applications using their namespace in my application - right?

But if I do so, can my first application say:
"Hey, I want the permission com.something.ABC which is just a harmless
permission 'read status'", and the user grants this permission.

When in fact later com.something gets installed and permission
com.something.ABC is in fact the permission to detonate a bomb. But
the user had already granted that permission, so the system allows the
first application to do so.

Am I seeing this correctly?

Peli

On 23 Jan., 18:52, Dianne Hackborn <[email protected]> wrote:
> Yes, the first app gets the permission.
>
> Basically don't do this.  That is why permission names, like so many of
> these things, specify to use fully-scoped names, so you can ensure that no
> other app conflicts with you.
>
>
>
> On Fri, Jan 23, 2009 at 6:21 AM, Peli <[email protected]> wrote:
>
> > What happens if 2 applications (one that offers a permission, and one
> > that uses it), define a permission in different ways?
>
> > Application A:
> > <permission android:name="xxx.MYPERMISSION"... />
> > <uses-permission android:name="xxx.MYPERMISSION".../>
> > <activity permission="xxx.MYPERMISSION" .../>
>
> > Application B:
> > <permission android:name="xxx.MYPERMISSION"... />
> > <uses-permission android:name="xxx.MYPERMISSION".../>
>
> > How are permissions enforced if the definitions given for the same
> > permission MYPERMISSION differ in application A and application B?
> > (i.e. if the labels differ, or the permission group or protection
> > level are different?)
>
> > Is it recommended that both applications define the same permission?
> > (I have noticed, if they do not, then the order of installation of the
> > two applications matters)
>
> > Peli
>
> --
> 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.  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