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

Commit e0d25ed3 authored by Alex Salo's avatar Alex Salo
Browse files

Fix adaptive_sleep resetting after reboot

When device is locked after reboot - packageManager cannot resolve
the service. Instead, rely on the configuration that is provided
at the sign time. SystemServer relies on this as well, so it is
consistent.

Bug: 151176054
Test: manually
Change-Id: Ifc1c078e3d774d63b8aeec2fe6b332305e47847b
parent 007b5f7e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public class AttentionManagerService extends SystemService {
     * Returns {@code true} if attention service is supported on this device.
     */
    private boolean isAttentionServiceSupported() {
        return isServiceEnabled() && isServiceAvailable();
        return isServiceEnabled() && isServiceConfigured(mContext);
    }

    @VisibleForTesting
@@ -210,6 +210,11 @@ public class AttentionManagerService extends SystemService {
            return false;
        }

        if (!isServiceAvailable()) {
            Slog.w(LOG_TAG, "Service is not available at this moment.");
            return false;
        }

        // don't allow attention check in screen off state
        if (!mPowerManager.isInteractive()) {
            return false;