[DO NOT MERGE] Do not report boot timings on first boot or runtime restart

During first boot after OTA, additional dexopting has to be done
during PM initialization. Timings for OTA are reported separately,
so we should ignore first boot to avoid skewing the metrics.

The following metrics were updated:
 - framework_locked_boot_completed
 - framework_boot_completed
 
Cherry-picked from commit 1d87e40d42

Test: manual
Bug: 32807863
Change-Id: I9d545cf38118f45f3f13597df2949d0ae4abd26a
This commit is contained in:
Fyodor Kupolov
2017-01-19 12:11:32 -08:00
parent 18f1a35d46
commit 83a218c416
3 changed files with 42 additions and 7 deletions

View File

@@ -208,6 +208,7 @@ public final class SystemServer {
private boolean mOnlyCore;
private boolean mFirstBoot;
private final boolean mRuntimeRestart;
/**
* Start the sensor service.
@@ -224,6 +225,8 @@ public final class SystemServer {
public SystemServer() {
// Check for factory test mode.
mFactoryTestMode = FactoryTest.getMode();
// Remember if it's runtime restart(when sys.boot_completed is already set) or reboot
mRuntimeRestart = "1".equals(SystemProperties.get("sys.boot_completed"));
}
private void run() {
@@ -323,6 +326,8 @@ public final class SystemServer {
// Create the system service manager.
mSystemServiceManager = new SystemServiceManager(mSystemContext);
mSystemServiceManager.setRuntimeRestarted(mRuntimeRestart);
mSystemServiceManager.setFirstBoot(mFirstBoot);
LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);