From 7f747ed810158c59b4c2585ef5a1df3508ac0419 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 10 May 2022 04:01:37 +0000 Subject: [PATCH] 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 --- services/java/com/android/server/SystemServer.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 319e63f7431a3..ce9cc1a22c7ac 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -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