SystemServer: remove FDE workaround from runtime restart detection

Since Full Disk Encryption (FDE) is no longer supported, SystemServer no
longer needs to take FDE into consideration when deciding whether a
runtime restart has occurred.

Bug: 208476087
Change-Id: I5150f488f05a2d4ab3e5fcc2b92ec376a569e7e2
This commit is contained in:
Eric Biggers
2022-05-10 04:01:37 +00:00
parent 106150d8a0
commit 7f747ed810

View File

@@ -651,19 +651,14 @@ public final class SystemServer implements Dumpable {
mFactoryTestMode = FactoryTest.getMode();
// Record process start information.
// Note SYSPROP_START_COUNT will increment by *2* on a FDE device when it fully boots;
// one for the password screen, second for the actual boot.
mStartCount = SystemProperties.getInt(SYSPROP_START_COUNT, 0) + 1;
mRuntimeStartElapsedTime = SystemClock.elapsedRealtime();
mRuntimeStartUptime = SystemClock.uptimeMillis();
Process.setStartTimes(mRuntimeStartElapsedTime, mRuntimeStartUptime,
mRuntimeStartElapsedTime, mRuntimeStartUptime);
// Remember if it's runtime restart(when sys.boot_completed is already set) or reboot
// We don't use "mStartCount > 1" here because it'll be wrong on a FDE device.
// TODO: mRuntimeRestart will *not* be set to true if the proccess crashes before
// sys.boot_completed is set. Fix it.
mRuntimeRestart = "1".equals(SystemProperties.get("sys.boot_completed"));
// Remember if it's runtime restart or reboot.
mRuntimeRestart = mStartCount > 1;
}
@Override