Separate job service for dynamic code logging.

Decouple logging of dynamic code loading from background DEX
optimisation/reconciliation (BackgroundDexOptService).

Add DynamicCodeLoggingService to run DCL logging daily while idle and
charging.

Update DexLoggerIntegrationTests to use the new job, and to verify
that we now handle unknown class loaders.

Bug: 111336847
Test: atest -p services/core/java/com/android/server/pm/dex
Change-Id: Id688a7eef5976120be12606e726830ce32451a1e
This commit is contained in:
Alan Stokes
2018-12-10 14:07:47 +00:00
parent 04c132139f
commit be9ec976c5
9 changed files with 613 additions and 225 deletions

View File

@@ -109,6 +109,7 @@ import com.android.server.os.DeviceIdentifiersPolicyService;
import com.android.server.os.SchedulingPolicyService;
import com.android.server.pm.BackgroundDexOptService;
import com.android.server.pm.CrossProfileAppsService;
import com.android.server.pm.DynamicCodeLoggingService;
import com.android.server.pm.Installer;
import com.android.server.pm.LauncherAppsService;
import com.android.server.pm.OtaDexoptService;
@@ -1666,6 +1667,18 @@ public final class SystemServer {
}
traceEnd();
if (!isWatch) {
// We don't run this on watches as there are no plans to use the data logged
// on watch devices.
traceBeginAndSlog("StartDynamicCodeLoggingService");
try {
DynamicCodeLoggingService.schedule(context);
} catch (Throwable e) {
reportWtf("starting DynamicCodeLoggingService", e);
}
traceEnd();
}
if (!isWatch) {
traceBeginAndSlog("StartPruneInstantAppsJobService");
try {