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

Commit 80c07c88 authored by Mao Jinlong's avatar Mao Jinlong Committed by Gerrit - the friendly Code Review server
Browse files

Don't start wallpaperManagerService when in power off alarm mode

As wallpaper is not necessary during power off alarm, don't start
wallpaperManagerService when it is alarm boot.

CRs-Fixed: 1063317
Change-Id: I0c3cb964af2044235c13c17f38994f5318d26a6b
parent a5865168
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -202,6 +202,7 @@ public final class SystemServer {


    private boolean mOnlyCore;
    private boolean mOnlyCore;
    private boolean mFirstBoot;
    private boolean mFirstBoot;
    private boolean mIsAlarmBoot;


    /**
    /**
     * Start the sensor service.
     * Start the sensor service.
@@ -441,13 +442,15 @@ public final class SystemServer {


        // 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");

        mIsAlarmBoot = SystemProperties.getBoolean("ro.alarm_boot", false);
        if (ENCRYPTING_STATE.equals(cryptState)) {
        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");
            mOnlyCore = true;
            mOnlyCore = true;
        } else if (ENCRYPTED_STATE.equals(cryptState)) {
        } else if (ENCRYPTED_STATE.equals(cryptState)) {
            Slog.w(TAG, "Device encrypted - only parsing core apps");
            Slog.w(TAG, "Device encrypted - only parsing core apps");
            mOnlyCore = true;
            mOnlyCore = true;
        } else if (SystemProperties.getBoolean("ro.alarm_boot", false)) {
        } else if (mIsAlarmBoot) {
            // power off alarm mode is similar to encryption mode. Only power off alarm
            // power off alarm mode is similar to encryption mode. Only power off alarm
            // applications will be parsed by packageParser. Some services or settings are
            // applications will be parsed by packageParser. Some services or settings are
            // not necessary to power off alarm mode. So reuse mOnlyCore for power off alarm
            // not necessary to power off alarm mode. So reuse mOnlyCore for power off alarm
@@ -975,7 +978,7 @@ public final class SystemServer {
            mSystemServiceManager.startService(DropBoxManagerService.class);
            mSystemServiceManager.startService(DropBoxManagerService.class);


            if (!disableNonCoreServices && context.getResources().getBoolean(
            if (!disableNonCoreServices && context.getResources().getBoolean(
                        R.bool.config_enableWallpaperService)) {
                        R.bool.config_enableWallpaperService) && !mIsAlarmBoot) {
                traceBeginAndSlog("StartWallpaperManagerService");
                traceBeginAndSlog("StartWallpaperManagerService");
                mSystemServiceManager.startService(WALLPAPER_SERVICE_CLASS);
                mSystemServiceManager.startService(WALLPAPER_SERVICE_CLASS);
                Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
                Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);