Get service call context

So, I am working on serviceone that will handle requests to send data to a socket.

I already programmed the socket in service, but in only one application. I would like it to just sit and do nothing until some application wants to send data for sending. This is all good and good.

I have registered intent filterregular material and can process the data. But I want to process the data coming from different activities in different threads (subsequent calls from the same application will be calculated in one thread).

Is there a way to get the calling package or application or something else? I would prefer not to require the transfer of an identifier as an extra to prevent spoofing. (This is not a serious security issue, but only each application requires data processing in the order in which it was received.)

+3
source share
1 answer

In the past, I ran into the same problem. I could not find a way to find out how to send the intention, and I ended up adding more.

If you do not want to use the excess, you might want to install Action, but this is almost the same.

0
source

Source: https://habr.com/ru/post/1762257/


All Articles