On Sat, Jun 1, 2013 at 3:39 PM, Marten Gajda <[email protected]> wrote:

>
> I have an existing app A that's already installed by a couple of users and
> I have developed a new app B that has a content provider and custom
> permissions for access control. Now I want to add optional support for that
> new content provider in app A.
>
> Just adding a <uses-permission> tag to app A won't work because all users
> would have to install app B before they upgrade to the new app A. Otherwise
> the new permission is not granted with the following message:
>
> W/PackageManager(  201): Not granting permission 
> my.package.permission.**PERMISSION_X
> to package my.other.package because it was previously installed without
>

Hello Marten, I'm slightly confused at this point.  The above log message
sounds to me as if you defined your permission in app A and requested it in
app B - the other way around compared to what you explanation above seems
to suggest.

At any rate, if you define your permission in app B (using the <permission>
element) and request it in app A (using the <uses-permission> element) it
should work.  If app A is installed before app B you should just see a log
message stating that the custom permission is unknown.  This is fine as app
B who defines it is not installed yet.  As soon as you install it the
permission is defined by B and granted to A.

Which Android version are you testing on?

My question is: Is that guaranteed to work in future Android releases? Is
> there a chance any future Android version will complain about the duplicate
> definition of the permission?


This is something I'd like to know too.  I"m not hopeful though Google
tells us before stuff breaks...

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to