Skip to content

Commit 553acf0

Browse files
author
Ben Komalo
committed
Only run "core" apps when encrypting device.
This forces the package manager to only read packages that have coreApp="true" in their manifest when encrypting the device, since no non-essential processes or applications should run in that time. Bug: 5031399 Change-Id: I87e8b27703e42553940167858db9473705d5d843
1 parent 79a33ad commit 553acf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
class ServerThread extends Thread {
6666
private static final String TAG = "SystemServer";
67+
private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
6768

6869
ContentResolver mContentResolver;
6970

@@ -147,9 +148,15 @@ public void run() {
147148
AttributeCache.init(context);
148149

149150
Slog.i(TAG, "Package Manager");
151+
// Only run "core" apps if we're encrypting the device.
152+
String cryptState = SystemProperties.get("vold.decrypt");
153+
boolean onlyCore = ENCRYPTING_STATE.equals(cryptState);
154+
if (onlyCore) {
155+
Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
156+
}
150157
pm = PackageManagerService.main(context,
151158
factoryTest != SystemServer.FACTORY_TEST_OFF,
152-
false);
159+
onlyCore);
153160

154161
ActivityManagerService.setSystemProcess();
155162

0 commit comments

Comments
 (0)