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

Commit b6c4d7c7 authored by Bryce Lee's avatar Bryce Lee
Browse files

Move timeout to idle value to config.

This changelist moves the timeout to idle
duration to a config value so it may be
set in an overlay.

Test: manual
Bug: 195116691
Change-Id: I0d4cefb7080ea76649f4cadcf459ef1229e8b58c
parent d118e25c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -691,4 +691,7 @@

    <!-- Timeout to idle mode duration in milliseconds. -->
    <integer name="config_idleModeTimeout">10000</integer>

    <!-- Tiemout to doze mode from idle in milliseconds. -->
    <integer name="config_dozeModeTimeout">15000</integer>
</resources>
+3 −2
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ public class IdleHostViewController extends ViewController<IdleHostView> {
    private static final String INPUT_MONITOR_IDENTIFIER = "IdleHostViewController";
    private static final String TAG = "IdleHostViewController";
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    private static final int TIMEOUT_TO_DOZE_MS = 10000;

    @Retention(RetentionPolicy.RUNTIME)
    @IntDef({STATE_IDLE_MODE_ENABLED, STATE_DOZING, STATE_KEYGUARD_SHOWING, STATE_IDLING})
@@ -89,6 +88,7 @@ public class IdleHostViewController extends ViewController<IdleHostView> {

    // Timeout to idle in milliseconds.
    private final int mIdleTimeout;
    private final int mDozeTimeout;

    // Factory for generating input listeners.
    private final InputMonitorFactory mInputMonitorFactory;
@@ -200,6 +200,7 @@ public class IdleHostViewController extends ViewController<IdleHostView> {
        setState(mState, true);

        mIdleTimeout = resources.getInteger(R.integer.config_idleModeTimeout);
        mDozeTimeout = resources.getInteger(R.integer.config_dozeModeTimeout);
        mInputMonitorFactory = factory;
        mDelayableExecutor = delayableExecutor;

@@ -296,7 +297,7 @@ public class IdleHostViewController extends ViewController<IdleHostView> {

        if (mIdleModeActive) {
            mCancelIdleModeToDoze = mDelayableExecutor.executeDelayed(mIdleModeToDozeCallback,
                    TIMEOUT_TO_DOZE_MS);
                    mDozeTimeout);

            // Track when the dream ends to cancel any timeouts.
            final IntentFilter filter = new IntentFilter();