summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/SystemServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r--services/java/com/android/server/SystemServer.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index c70d8068f087..a00a624a82f0 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -104,7 +104,6 @@ import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.widget.ILockSettings;
import com.android.server.am.ActivityManagerService;
import com.android.server.appbinding.AppBindingService;
-import com.android.server.art.ArtManagerLocal;
import com.android.server.attention.AttentionManagerService;
import com.android.server.audio.AudioService;
import com.android.server.biometrics.AuthService;
@@ -550,6 +549,8 @@ public final class SystemServer implements Dumpable {
new Thread(() -> {
boolean enabled = false;
+ long nextWrite = 0;
+
while (true) {
int maxFd = getMaxFd();
if (maxFd > enableThreshold) {
@@ -560,12 +561,30 @@ public final class SystemServer implements Dumpable {
if (maxFd > enableThreshold && !enabled) {
Slog.i("System", "fdtrack enable threshold reached, enabling");
+ FrameworkStatsLog.write(FrameworkStatsLog.FDTRACK_EVENT_OCCURRED,
+ FrameworkStatsLog.FDTRACK_EVENT_OCCURRED__EVENT__ENABLED,
+ maxFd);
+
System.loadLibrary("fdtrack");
enabled = true;
} else if (maxFd > abortThreshold) {
Slog.i("System", "fdtrack abort threshold reached, dumping and aborting");
+ FrameworkStatsLog.write(FrameworkStatsLog.FDTRACK_EVENT_OCCURRED,
+ FrameworkStatsLog.FDTRACK_EVENT_OCCURRED__EVENT__ABORTING,
+ maxFd);
+
dumpHprof();
fdtrackAbort();
+ } else {
+ // Limit this to once per hour.
+ long now = SystemClock.elapsedRealtime();
+ if (now > nextWrite) {
+ nextWrite = now + 60 * 60 * 1000;
+ FrameworkStatsLog.write(FrameworkStatsLog.FDTRACK_EVENT_OCCURRED,
+ enabled ? FrameworkStatsLog.FDTRACK_EVENT_OCCURRED__EVENT__ENABLED
+ : FrameworkStatsLog.FDTRACK_EVENT_OCCURRED__EVENT__DISABLED,
+ maxFd);
+ }
}
try {
@@ -1802,7 +1821,7 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
t.traceBegin("StartFontManagerService");
- mSystemServiceManager.startService(FontManagerService.Lifecycle.class);
+ mSystemServiceManager.startService(new FontManagerService.Lifecycle(context, safeMode));
t.traceEnd();
t.traceBegin("StartTextServicesManager");
@@ -2668,10 +2687,6 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(GAME_MANAGER_SERVICE_CLASS);
t.traceEnd();
- t.traceBegin("ArtManagerLocal");
- LocalManagerRegistry.addManager(ArtManagerLocal.class, new ArtManagerLocal());
- t.traceEnd();
-
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_UWB)) {
t.traceBegin("UwbService");
mSystemServiceManager.startService(UWB_SERVICE_CLASS);