Am Samstag, 1. Juni 2013 17:28:31 UTC+2 schrieb latimerius:
>
> On Sat, Jun 1, 2013 at 3:39 PM, Marten Gajda <mar...@dmfs.org<javascript:>
> > 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.
>

I should have changed the log message to

W/PackageManager(  201): Not granting permission B.PERMISSION_X to package 
A because it was previously installed without

that's what I get actually. The problem seems to be, that since 
B.PERMISSION_X was not known at the time A was installed (but B wasn't) the 
permission had been ignored.

I'm not the only one experiencing this issue: 
https://groups.google.com/forum/?fromgroups#!topic/android-platform/jQBhijWPcTQ
 

>
> 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.
>

I see that message, but when I install B I get the message above. 

 

>  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.
>

That doesn't seem to work on all devices.


> Which Android version are you testing on? 
>

The issue has been reported on SDK levels 15, 16 and 17. I didn't test 
earlier versions yet.
 

>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to