Hi Nicolay, thanks for the reply. true, there is a point in what you say about the processes.
so there are two separate APK's. I can see they are running in two different processes. still, the message seems to come from the service itself: although the message is called from the remote client process (pid 6969), when the service methods (onBind and handleMessage) are called, the Binder.getCallingPid() returns the pid of the service itself (6985). (I can only assume there is some configuration that needs to be set, or something that I am missing here) any idea? thanks! On Thursday, March 6, 2014 5:50:21 AM UTC+2, Nikolay Elenkov wrote: > > On Thu, Mar 6, 2014 at 7:13 AM, smoogli <[email protected] <javascript:>> > 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.

