Merge "CachedAppOptimizer: remove native freezer enabling code" into sc-dev

This commit is contained in:
Marco Ballesio
2021-02-25 16:27:59 +00:00
committed by Android (Google) Code Review
2 changed files with 0 additions and 33 deletions

View File

@@ -535,18 +535,6 @@ public final class CachedAppOptimizer {
return true;
}
/**
* Enable or disable the freezer. When enable == false all frozen processes are unfrozen,
* but aren't removed from the freezer. While in this state, processes can be added or removed
* by using Process.setProcessFrozen(), but they wouldn't be actually frozen until the freezer
* is enabled. If enable == true all processes in the freezer are frozen.
*
* @param enable Specify whether to enable (true) or disable (false) the freezer.
*
* @hide
*/
private static native void enableFreezerInternal(boolean enable);
/**
* Informs binder that a process is about to be frozen. If freezer is enabled on a process via
* this method, this method will synchronously dispatch all pending transactions to the
@@ -590,10 +578,6 @@ public final class CachedAppOptimizer {
if (state == '1' || state == '0') {
supported = true;
// This is a workaround after reverting the cgroup v2 uid/pid hierarchy due to
// http://b/179006802.
// TODO: remove once the uid/pid hierarchy is restored
enableFreezerInternal(true);
} else {
Slog.e(TAG_AM, "unexpected value in cgroup.freeze");
}

View File

@@ -232,21 +232,6 @@ static void com_android_server_am_CachedAppOptimizer_compactProcess(JNIEnv*, job
compactProcessOrFallback(pid, compactionFlags);
}
static void com_android_server_am_CachedAppOptimizer_enableFreezerInternal(
JNIEnv *env, jobject clazz, jboolean enable) {
bool success = true;
if (enable) {
success = SetTaskProfiles(0, {"FreezerEnabled"}, true);
} else {
success = SetTaskProfiles(0, {"FreezerDisabled"}, true);
}
if (!success) {
jniThrowException(env, "java/lang/RuntimeException", "Unknown error");
}
}
static void com_android_server_am_CachedAppOptimizer_freezeBinder(
JNIEnv *env, jobject clazz, jint pid, jboolean freeze) {
@@ -287,8 +272,6 @@ static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"compactSystem", "()V", (void*)com_android_server_am_CachedAppOptimizer_compactSystem},
{"compactProcess", "(II)V", (void*)com_android_server_am_CachedAppOptimizer_compactProcess},
{"enableFreezerInternal", "(Z)V",
(void*)com_android_server_am_CachedAppOptimizer_enableFreezerInternal},
{"freezeBinder", "(IZ)V", (void*)com_android_server_am_CachedAppOptimizer_freezeBinder},
{"getBinderFreezeInfo", "(I)I",
(void*)com_android_server_am_CachedAppOptimizer_getBinderFreezeInfo},