Fix permissions handling.
+ Rename the permissions as per: http://go/android-multinetwork-routing
+ Make the SYSTEM permission explicitly include NETWORK.
+ Grant the SYSTEM permission to system UIDs by default, but allow the framework
to override them if necessary.
+ Move the "string to permission" parsing to CommandListener.cpp, thus allowing
us to get rid of Permission.cpp.
+ There's no need to support multiple permissions string arguments, so tighten
that up.
Change-Id: I73d51b5e2f44a97e6d5ab5943ff198cebfbcc0c4
diff --git a/server/FwmarkServer.cpp b/server/FwmarkServer.cpp
index 71d15f9..e2d2079 100644
--- a/server/FwmarkServer.cpp
+++ b/server/FwmarkServer.cpp
@@ -117,8 +117,8 @@
} else {
fwmark.explicitlySelected = true;
// If the socket already has the protectedFromVpn bit set, don't reset it, because
- // non-CONNECTIVITY_INTERNAL apps (e.g.: VpnService) may also protect sockets.
- if (permission & PERMISSION_CONNECTIVITY_INTERNAL) {
+ // non-system apps (e.g.: VpnService) may also protect sockets.
+ if ((permission & PERMISSION_SYSTEM) == PERMISSION_SYSTEM) {
fwmark.protectedFromVpn = true;
}
if (!mNetworkController->isValidNetwork(command.netId)) {