Merge \\\"Handle alarm firing outside of DND period.\\\" into nyc-dev am: e1451c4e30 am: 5431ee2aca
am: 2a6f616385
Change-Id: I87ba4667946581206a53430932a7e37a98b96736
diff --git a/services/core/java/com/android/server/notification/ScheduleCalendar.java b/services/core/java/com/android/server/notification/ScheduleCalendar.java
index 9267d82..22ca702 100644
--- a/services/core/java/com/android/server/notification/ScheduleCalendar.java
+++ b/services/core/java/com/android/server/notification/ScheduleCalendar.java
@@ -58,11 +58,7 @@
final long nextEnd = getNextTime(now, mSchedule.endHour, mSchedule.endMinute);
long nextScheduleTime = Math.min(nextStart, nextEnd);
- if (mSchedule.exitAtAlarm && mSchedule.nextAlarm > now) {
- return Math.min(nextScheduleTime, mSchedule.nextAlarm);
- } else {
- return nextScheduleTime;
- }
+ return nextScheduleTime;
}
private long getNextTime(long now, int hr, int min) {
@@ -124,4 +120,4 @@
mCalendar.add(Calendar.DATE, days);
return mCalendar.getTimeInMillis();
}
-}
\ No newline at end of file
+}
diff --git a/services/core/java/com/android/server/notification/ScheduleConditionProvider.java b/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
index e3dcf14..8197544 100644
--- a/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
+++ b/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
@@ -43,8 +43,8 @@
* Built-in zen condition provider for daily scheduled time-based conditions.
*/
public class ScheduleConditionProvider extends SystemConditionProviderService {
- private static final String TAG = "ConditionProviders.SCP";
- private static final boolean DEBUG = true || Log.isLoggable("ConditionProviders", Log.DEBUG);
+ static final String TAG = "ConditionProviders.SCP";
+ static final boolean DEBUG = true || Log.isLoggable("ConditionProviders", Log.DEBUG);
public static final ComponentName COMPONENT =
new ComponentName("android", ScheduleConditionProvider.class.getName());
@@ -154,6 +154,9 @@
cal.maybeSetNextAlarm(now, nextUserAlarmTime);
} else {
notifyCondition(conditionId, Condition.STATE_FALSE, "!meetsSchedule");
+ if (nextUserAlarmTime == 0) {
+ cal.maybeSetNextAlarm(now, nextUserAlarmTime);
+ }
}
if (cal != null) {
final long nextChangeTime = cal.getNextChangeTime(now);