Skip to content
Snippets Groups Projects
Commit 2b1b2c72 authored by Patrick Rohr's avatar Patrick Rohr
Browse files

Revert "Prevent native_init from starting TrafficController"

We are ready to remove traffic controller from netd, so
TrafficController::start() should be called from the system server.

This reverts commit c2984fdc.

Test: atest FrameworksNetTests FrameworksNetIntegrationTests
CtsNetTestCases:android.net.TrafficStatsTest NetworkUsageStatsTest
CtsHostsideNetworkTests

Change-Id: Ic324ad0c064271977ab35d7f55badee00098e196
parent d817436f
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,7 @@ static android::net::TrafficController mTc;
namespace android {
static void native_init(JNIEnv* env, jobject clazz) {
// start is still being called by netd
Status status = mTc.initMaps();
Status status = mTc.start();
if (!isOk(status)) {
ALOGE("%s failed", __func__);
}
......
......@@ -32,22 +32,14 @@ namespace net {
using netdutils::StatusOr;
class TrafficController {
// TODO: marking this private for right now, as start is already called by
// netd. start() calls initMaps(), initPrograms(), and sets up the socket
// destroy listener. Both initPrograms() and setting up the socket destroy
// listener should only be done once.
public:
static constexpr char DUMP_KEYWORD[] = "trafficcontroller";
/*
* Initialize the whole controller
*/
netdutils::Status start();
public:
static constexpr char DUMP_KEYWORD[] = "trafficcontroller";
// TODO: marking this public for right now, as start() is already called by
// netd.
netdutils::Status initMaps() EXCLUDES(mMutex);
int setCounterSet(int counterSetNum, uid_t uid, uid_t callingUid) EXCLUDES(mMutex);
/*
......@@ -195,6 +187,8 @@ class TrafficController {
std::mutex mMutex;
netdutils::Status initMaps() EXCLUDES(mMutex);
// Keep track of uids that have permission UPDATE_DEVICE_STATS so we don't
// need to call back to system server for permission check.
std::set<uid_t> mPrivilegedUser GUARDED_BY(mMutex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment