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

Commit 2ea42e9f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Alarm: ignore less than 2 mins upcomming power off alarm"

parents ee613910 01d38893
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ class AlarmManagerService extends IAlarmManager.Stub {
    // warning message.  The time duration is in milliseconds.
    private static final long LATE_ALARM_THRESHOLD = 10 * 1000;

    // The threshold for the power off alarm time can be set. The time
    // duration is in milliseconds.
    private static final long POWER_OFF_ALARM_THRESHOLD = 120 * 1000;

    private static final int RTC_WAKEUP_MASK = 1 << RTC_WAKEUP;
    private static final int RTC_MASK = 1 << RTC;
    private static final int ELAPSED_REALTIME_WAKEUP_MASK = 1 << ELAPSED_REALTIME_WAKEUP; 
@@ -689,7 +693,8 @@ class AlarmManagerService extends IAlarmManager.Stub {
        final int N = mAlarmBatches.size();
        for (int i = 0; i < N; i++) {
            Batch b = mAlarmBatches.get(i);
            if (b.isRtcPowerOffWakeup()) {
            long intervalTime  = b.start - SystemClock.elapsedRealtime();
            if (b.isRtcPowerOffWakeup() && intervalTime > POWER_OFF_ALARM_THRESHOLD) {
                return b;
            }
        }