Skip to content

Commit 3573d40

Browse files
author
Ben Komalo
committed
Enter minimal boot mode when booting encrypted
Bug: 5233488 Change-Id: Iba7a41c69af2387594d2be562d587918cd17a348
1 parent b20d378 commit 3573d40

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

services/java/com/android/server/SystemServer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
class ServerThread extends Thread {
6666
private static final String TAG = "SystemServer";
6767
private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
68+
private static final String ENCRYPTED_STATE = "1";
6869

6970
ContentResolver mContentResolver;
7071

@@ -150,10 +151,15 @@ public void run() {
150151
Slog.i(TAG, "Package Manager");
151152
// Only run "core" apps if we're encrypting the device.
152153
String cryptState = SystemProperties.get("vold.decrypt");
153-
boolean onlyCore = ENCRYPTING_STATE.equals(cryptState);
154-
if (onlyCore) {
154+
boolean onlyCore = false;
155+
if (ENCRYPTING_STATE.equals(cryptState)) {
155156
Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
157+
onlyCore = true;
158+
} else if (ENCRYPTED_STATE.equals(cryptState)) {
159+
Slog.w(TAG, "Device encrypted - only parsing core apps");
160+
onlyCore = true;
156161
}
162+
157163
pm = PackageManagerService.main(context,
158164
factoryTest != SystemServer.FACTORY_TEST_OFF,
159165
onlyCore);

0 commit comments

Comments
 (0)