summaryrefslogtreecommitdiff
path: root/server/TetherController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/TetherController.cpp')
-rw-r--r--server/TetherController.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index c9a93fd6..44c7e35a 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -27,16 +27,19 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <base/file.h>
#define LOG_TAG "TetherController"
#include <cutils/log.h>
#include <cutils/properties.h>
-#include <utils/file.h>
#include "Fwmark.h"
#include "NetdConstants.h"
#include "Permission.h"
#include "TetherController.h"
+using android::base::ReadFileToString;
+using android::base::WriteStringToFile;
+
TetherController::TetherController() {
mInterfaces = new InterfaceCollection();
mDnsNetId = 0;
@@ -67,7 +70,7 @@ int TetherController::setIpFwdEnabled(bool enable) {
return 0;
}
- if (!android::WriteStringToFile(enable ? "1" : "0", "/proc/sys/net/ipv4/ip_forward")) {
+ if (!WriteStringToFile(enable ? "1" : "0", "/proc/sys/net/ipv4/ip_forward")) {
ALOGE("Failed to write ip_forward (%s)", strerror(errno));
return -1;
}
@@ -77,7 +80,7 @@ int TetherController::setIpFwdEnabled(bool enable) {
bool TetherController::getIpFwdEnabled() {
std::string enabled;
- if (!android::ReadFileToString("/proc/sys/net/ipv4/ip_forward", &enabled)) {
+ if (!ReadFileToString("/proc/sys/net/ipv4/ip_forward", &enabled)) {
ALOGE("Failed to read ip_forward (%s)", strerror(errno));
return -1;
}