Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e154c72e authored by Carmen Jackson's avatar Carmen Jackson Committed by android-build-merger
Browse files

Merge "Added system_server to system group" into oc-mr1-dev

am: 22d05556

Change-Id: I0b6deacd471b2a6c082cb2cc916e8ee577045c9e
parents 185886f3 22d05556
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@
#include <unistd.h>

#include "android-base/logging.h"
#include <android-base/file.h>
#include <android-base/stringprintf.h>
#include <cutils/fs.h>
#include <cutils/multiuser.h>
#include <cutils/sched_policy.h>
@@ -65,6 +67,8 @@
namespace {

using android::String8;
using android::base::StringPrintf;
using android::base::WriteStringToFile;

static pid_t gSystemServerPid = 0;

@@ -770,6 +774,11 @@ static jint com_android_internal_os_Zygote_nativeForkSystemServer(
          ALOGE("System server process %d has died. Restarting Zygote!", pid);
          RuntimeAbort(env, __LINE__, "System server process has died. Restarting Zygote!");
      }

      // Assign system_server to the correct memory cgroup.
      if (!WriteStringToFile(StringPrintf("%d", pid), "/dev/memcg/system/tasks")) {
        ALOGE("couldn't write %d to /dev/memcg/system/tasks", pid);
      }
  }
  return pid;
}