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

Commit a5491ca3 authored by Lijuan Gao's avatar Lijuan Gao Committed by Gerrit - the friendly Code Review server
Browse files

Alarm: keep the alarm which is the 2 minutes upcoming power off alarm

Power off alarm need be triggered on time, so couldn't ignore less
than 2 minutes upcoming power off alarm. and treat it as a normal
alarm

Change-Id: I9ce8ee588d599150ad63db51e539337369b712f9
parent 8e6ce499
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -78,10 +78,6 @@ class AlarmManagerService extends SystemService {
    // 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;
@@ -1148,8 +1144,7 @@ class AlarmManagerService extends SystemService {
        final int N = mAlarmBatches.size();
        for (int i = 0; i < N; i++) {
            Batch b = mAlarmBatches.get(i);
            long intervalTime  = b.start - SystemClock.elapsedRealtime();
            if (b.isRtcPowerOffWakeup() && intervalTime > POWER_OFF_ALARM_THRESHOLD) {
            if (b.isRtcPowerOffWakeup()) {
                return b;
            }
        }