Merge "profcollectd: Only start the forwarding service if enabled through device config" am: fb8f388ce7 am: f69edfbddf

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1484896

Change-Id: Ibfb865ebb83200698644644e4afef85a1e44e943
This commit is contained in:
Yi Kong
2020-11-03 10:28:49 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 1 deletions

View File

@@ -1226,7 +1226,7 @@ public final class SystemServer {
mSystemServiceManager.startService(IorapForwardingService.class);
t.traceEnd();
if (Build.IS_DEBUGGABLE) {
if (Build.IS_DEBUGGABLE && ProfcollectForwardingService.enabled()) {
t.traceBegin("ProfcollectForwardingService");
mSystemServiceManager.startService(ProfcollectForwardingService.class);
t.traceEnd();

View File

@@ -31,6 +31,7 @@ import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UpdateEngine;
import android.os.UpdateEngineCallback;
import android.provider.DeviceConfig;
import android.util.Log;
import com.android.server.IoThread;
@@ -68,6 +69,14 @@ public final class ProfcollectForwardingService extends SystemService {
sSelfService = this;
}
/**
* Check whether profcollect is enabled through device config.
*/
public static boolean enabled() {
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PROFCOLLECT_NATIVE_BOOT, "enabled",
false);
}
@Override
public void onStart() {
if (DEBUG) {