On Thu, Mar 6, 2014 at 7:13 AM, smoogli <[email protected]> wrote:
> Hi,
> I created a service whose handleMessage() is triggered by a remote activity.
> works fine...
>
> then, wanted to add a check that the remote activity has the required
> permission so added a call for
> checkCallingPermission("android.permission.INTERNET"); and added
> <uses-permission android:name="android.permission.INTERNET"/>  to the remote
> activity.
>
> still, at the service side, checkCallingPermission() always returns -1
> see code from service below.
>

Who is sending the Message? checkCallingPermission()  only works in the
context of an IPC call, if it's a local call you always get false (see JavaDoc).
Check Binder.getCalingUid().

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