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

Commit 0aba2927 authored by Matt Gilbride's avatar Matt Gilbride Committed by Android (Google) Code Review
Browse files

Merge "Setup UprobeStatsService" into main

parents 7719f382 19dc5cee
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -468,6 +468,10 @@ public final class SystemServer implements Dumpable {
            "com.android.os.profiling.anomaly.AnomalyDetectorService";
    private static final String SIGNAL_COLLECTOR_SERVICE_CLASS =
            "com.android.server.signalcollector";
    private static final String UPROBESTATS_SERVICE_JAR_PATH =
            "/apex/com.android.uprobestats/javalib/service-uprobestats.jar";
    private static final String UPROBESTATS_SERVICE_CLASS =
            "com.android.os.uprobestats.UprobeStatsService";

    private static final String RANGING_APEX_SERVICE_JAR_PATH =
            "/apex/com.android.uwb/javalib/service-ranging.jar";
@@ -2985,6 +2989,23 @@ public final class SystemServer implements Dumpable {
            t.traceEnd();
        }

        // UprobeStats
        if (android.security.Flags.serviceUprobestats()) {
            t.traceBegin("StartUprobeStatsService");
            // The service class is defined in a mainline module, and is not providing any
            // core, user facing functionality. It is only used for collecting telemetry
            // and anti-abuse. Thus, catch any startup exceptions and report them as WTFs.
            try {
                mSystemServiceManager.startServiceFromJar(
                        UPROBESTATS_SERVICE_CLASS, UPROBESTATS_SERVICE_JAR_PATH);
            } catch (Throwable e) {
                reportWtf("StartUprobeStatsService", e);
            }
            t.traceEnd();
        } else if (Build.IS_DEBUGGABLE) {
            Slog.d(TAG, "UprobeStatsService disabled by flag");
        }

        if (safeMode) {
            mActivityManagerService.enterSafeMode();
        }