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

Commit 9767e2a4 authored by Marco Ballesio's avatar Marco Ballesio
Browse files

CachedAppOptimizer: use new cgroup api for freezer path

Use the new cgroup API in place of the hardcoded path.
The new libprocessgroup API is defined in https://r.android.com/1607196

Bug: 180056337
Test: verified the freezer work via logs
Change-Id: I73c0976f3a917890bcd888c232975e2258f87b5c
parent 1f212657
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -280,7 +280,13 @@ static jint com_android_server_am_CachedAppOptimizer_getBinderFreezeInfo(JNIEnv

static jstring com_android_server_am_CachedAppOptimizer_getFreezerCheckPath(JNIEnv* env,
                                                                            jobject clazz) {
    return env->NewStringUTF(CGROUP_FREEZE_PATH);
    std::string path;

    if (!getAttributePathForTask("FreezerState", getpid(), &path)) {
        path = "";
    }

    return env->NewStringUTF(path.c_str());
}

static const JNINativeMethod sMethods[] = {