Loading services/core/java/com/android/server/AlarmManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -3077,10 +3077,10 @@ class AlarmManagerService extends SystemService { if ((alarm.flags&AlarmManager.FLAG_ALLOW_WHILE_IDLE) != 0) { if ((alarm.flags&AlarmManager.FLAG_ALLOW_WHILE_IDLE) != 0) { // If this is an ALLOW_WHILE_IDLE alarm, we constrain how frequently the app can // If this is an ALLOW_WHILE_IDLE alarm, we constrain how frequently the app can // schedule such alarms. // schedule such alarms. The first such alarm from an app is always delivered. final long lastTime = mLastAllowWhileIdleDispatch.get(alarm.creatorUid, 0); final long lastTime = mLastAllowWhileIdleDispatch.get(alarm.creatorUid, -1); final long minTime = lastTime + getWhileIdleMinIntervalLocked(alarm.creatorUid); final long minTime = lastTime + getWhileIdleMinIntervalLocked(alarm.creatorUid); if (nowELAPSED < minTime) { if (lastTime >= 0 && nowELAPSED < minTime) { // Whoops, it hasn't been long enough since the last ALLOW_WHILE_IDLE // Whoops, it hasn't been long enough since the last ALLOW_WHILE_IDLE // alarm went off for this app. Reschedule the alarm to be in the // alarm went off for this app. Reschedule the alarm to be in the // correct time period. // correct time period. Loading Loading
services/core/java/com/android/server/AlarmManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -3077,10 +3077,10 @@ class AlarmManagerService extends SystemService { if ((alarm.flags&AlarmManager.FLAG_ALLOW_WHILE_IDLE) != 0) { if ((alarm.flags&AlarmManager.FLAG_ALLOW_WHILE_IDLE) != 0) { // If this is an ALLOW_WHILE_IDLE alarm, we constrain how frequently the app can // If this is an ALLOW_WHILE_IDLE alarm, we constrain how frequently the app can // schedule such alarms. // schedule such alarms. The first such alarm from an app is always delivered. final long lastTime = mLastAllowWhileIdleDispatch.get(alarm.creatorUid, 0); final long lastTime = mLastAllowWhileIdleDispatch.get(alarm.creatorUid, -1); final long minTime = lastTime + getWhileIdleMinIntervalLocked(alarm.creatorUid); final long minTime = lastTime + getWhileIdleMinIntervalLocked(alarm.creatorUid); if (nowELAPSED < minTime) { if (lastTime >= 0 && nowELAPSED < minTime) { // Whoops, it hasn't been long enough since the last ALLOW_WHILE_IDLE // Whoops, it hasn't been long enough since the last ALLOW_WHILE_IDLE // alarm went off for this app. Reschedule the alarm to be in the // alarm went off for this app. Reschedule the alarm to be in the // correct time period. // correct time period. Loading