daimajia / droidwall

Automatically exported from code.google.com/p/droidwall
0 stars 0 forks source link

Background Networking #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Allow/Disallow application to do networking in background (i.e. if there is no 
application Activity's are in Foreground).

Original issue reported on code.google.com by ujn.g...@gmail.com on 14 Oct 2011 at 7:14

GoogleCodeExporter commented 9 years ago
This is not possible to implement using iptables nor with the Android API, 
unfortunately.
I would also find this to very useful if it could be implemented :)
Sorry

Original comment by rodrigo...@gmail.com on 17 Oct 2011 at 11:35

GoogleCodeExporter commented 9 years ago
You actually *can* detect "foreground" processes. For this call:

ActivityManager.getRunningAppProcesses()

And then go trough the list and inspect "importance" field of each 
"RunningAppProcessInfo" entry. If it has "IMPORTANCE_FOREGROUND" value it may 
be considered as foreground. 

I haven't tested this myself though.

Original comment by ujn.g...@gmail.com on 17 Oct 2011 at 11:42

GoogleCodeExporter commented 9 years ago
I know I can detect foreground processes - this is not the issue.
You need to understand how iptables and the kernel netfilter work.

DroidWall is NOT a resident service that blocks/allows connections, it is just 
a front-end for iptables and the kernel netfilter.

Original comment by rodrigo...@gmail.com on 17 Oct 2011 at 11:47