Merge "profcollect: Use DeviceConfig to control trace parameters" am: be52daface

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

Change-Id: Ib775fb17b8e9acff0c1f3e2ad4ec1f9873df4ad3
This commit is contained in:
Yi Kong
2020-11-12 04:13:16 +00:00
committed by Automerger Merge Worker

View File

@@ -28,7 +28,6 @@ import android.os.IBinder.DeathRecipient;
import android.os.Looper; import android.os.Looper;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UpdateEngine; import android.os.UpdateEngine;
import android.os.UpdateEngineCallback; import android.os.UpdateEngineCallback;
import android.provider.DeviceConfig; import android.provider.DeviceConfig;
@@ -227,8 +226,8 @@ public final class ProfcollectForwardingService extends SystemService {
} }
// Sample for a fraction of app launches. // Sample for a fraction of app launches.
int traceFrequency = int traceFrequency = DeviceConfig.getInt(DeviceConfig.NAMESPACE_PROFCOLLECT_NATIVE_BOOT,
SystemProperties.getInt("persist.profcollectd.applaunch_trace_freq", 2); "applaunch_trace_freq", 2);
int randomNum = ThreadLocalRandom.current().nextInt(100); int randomNum = ThreadLocalRandom.current().nextInt(100);
if (randomNum < traceFrequency) { if (randomNum < traceFrequency) {
try { try {