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

Commit 7730cd27 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

DO NOT MERGE Fix issue #24118803: The screen doesn't turn off...

...after more than 60 minutes left

The sensing timeout alarm was being cancelled immediately after it
was scheduled it.  Now only cancel it when we are done sensing or
have reset activity.

Change-Id: Id0440cda7dd1b81bf871f16dfb015df6284cf6af
parent 33e1d376
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1280,7 +1280,6 @@ public class DeviceIdleController extends SystemService
                if (DEBUG) Slog.d(TAG, "Moved from STATE_IDLE_PENDING to STATE_SENSING.");
                EventLogTags.writeDeviceIdle(mState, "step");
                scheduleSensingAlarmLocked(mConstants.SENSING_TIMEOUT);
                cancelSensingAlarmLocked();
                cancelLocatingLocked();
                mAnyMotionDetector.checkForAnyMotion();
                mNotMoving = false;
@@ -1292,7 +1291,6 @@ public class DeviceIdleController extends SystemService
                mState = STATE_LOCATING;
                if (DEBUG) Slog.d(TAG, "Moved from STATE_SENSING to STATE_LOCATING.");
                EventLogTags.writeDeviceIdle(mState, "step");
                cancelSensingAlarmLocked();
                scheduleSensingAlarmLocked(mConstants.LOCATING_TIMEOUT);
                mLocating = true;
                mLocationManager.requestLocationUpdates(mLocationRequest, mGenericLocationListener,
@@ -1350,6 +1348,7 @@ public class DeviceIdleController extends SystemService
            mState = STATE_ACTIVE;
            mInactiveTimeout = timeout;
            EventLogTags.writeDeviceIdle(mState, type);
            cancelSensingAlarmLocked();
            becomeInactiveIfAppropriateLocked();
        }
    }