OSDN Git Service

Make FirewallController::createChain use replaceUidChain.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 13 May 2016 08:03:42 +0000 (17:03 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Mon, 16 May 2016 11:35:37 +0000 (20:35 +0900)
commita55388e3f3dd726e470e195770649a2797d7e02f
treef30048299b557c623eea82230481f80653625f79
parentf157caf303ab397b3d350b33c842f79902058d16
Make FirewallController::createChain use replaceUidChain.

This has two benefits:

1. It makes the behaviour of setting firewall chains via the
   firewallReplaceUidChain RPC match the behaviour of creating
   the chains on boot. (As a side effect, it reduces code
   duplication between the two.)
2. It makes creating firewall chains on boot use iptables-restore,
   which is substantially faster than running iptables commands
   one at a time.

This CL will allow the framework to switch to using
firewallReplaceUidChain when the framework starts, providing
substantial speedups over the current behaviour of running two
iptables commands for every app that is whitelisted or idle.

Bug: 26675191
Change-Id: Ifbd15bf9143efd526570dde8f88effc79d164630
server/FirewallController.cpp
server/FirewallControllerTest.cpp