Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3573d400 authored by Ben Komalo's avatar Ben Komalo
Browse files

Enter minimal boot mode when booting encrypted

Bug: 5233488
Change-Id: Iba7a41c69af2387594d2be562d587918cd17a348
parent b20d378c
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@ import java.util.TimerTask;
class ServerThread extends Thread {
class ServerThread extends Thread {
    private static final String TAG = "SystemServer";
    private static final String TAG = "SystemServer";
    private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
    private static final String ENCRYPTING_STATE = "trigger_restart_min_framework";
    private static final String ENCRYPTED_STATE = "1";


    ContentResolver mContentResolver;
    ContentResolver mContentResolver;


@@ -150,10 +151,15 @@ class ServerThread extends Thread {
            Slog.i(TAG, "Package Manager");
            Slog.i(TAG, "Package Manager");
            // Only run "core" apps if we're encrypting the device.
            // Only run "core" apps if we're encrypting the device.
            String cryptState = SystemProperties.get("vold.decrypt");
            String cryptState = SystemProperties.get("vold.decrypt");
            boolean onlyCore = ENCRYPTING_STATE.equals(cryptState);
            boolean onlyCore = false;
            if (onlyCore) {
            if (ENCRYPTING_STATE.equals(cryptState)) {
                Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
                Slog.w(TAG, "Detected encryption in progress - only parsing core apps");
                onlyCore = true;
            } else if (ENCRYPTED_STATE.equals(cryptState)) {
                Slog.w(TAG, "Device encrypted - only parsing core apps");
                onlyCore = true;
            }
            }

            pm = PackageManagerService.main(context,
            pm = PackageManagerService.main(context,
                    factoryTest != SystemServer.FACTORY_TEST_OFF,
                    factoryTest != SystemServer.FACTORY_TEST_OFF,
                    onlyCore);
                    onlyCore);