|
|
|
@ -47,7 +47,7 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
|
|
|
|
|
|
|
|
Intent intent = new Intent();
|
|
|
|
Intent intent = new Intent();
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_DUE);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_DUE);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
assertTrue(triggered.value);
|
|
|
|
assertTrue(triggered.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -77,7 +77,7 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
|
|
|
|
|
|
|
|
Intent intent = new Intent();
|
|
|
|
Intent intent = new Intent();
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_DUE);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_DUE);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
|
|
|
|
|
|
|
|
Intent intent = new Intent();
|
|
|
|
Intent intent = new Intent();
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.ID_KEY, task.getId());
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_DUE);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_DUE);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -131,7 +131,7 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
assertTrue(notification.vibrate.length > 0);
|
|
|
|
assertTrue(notification.vibrate.length > 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_DUE);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_DUE);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
|
|
|
|
|
|
|
|
// random notification does not
|
|
|
|
// random notification does not
|
|
|
|
@ -143,8 +143,8 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
notification.vibrate.length == 0);
|
|
|
|
notification.vibrate.length == 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
intent.removeExtra(Notifications.TYPE_KEY);
|
|
|
|
intent.removeExtra(Notifications.EXTRAS_TYPE);
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_RANDOM);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_RANDOM);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
|
|
|
|
|
|
|
|
// wrapping works
|
|
|
|
// wrapping works
|
|
|
|
@ -157,8 +157,8 @@ public class NotificationTests extends DatabaseTestCase {
|
|
|
|
assertTrue((notification.defaults & Notification.DEFAULT_SOUND) == 0);
|
|
|
|
assertTrue((notification.defaults & Notification.DEFAULT_SOUND) == 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
intent.removeExtra(Notifications.TYPE_KEY);
|
|
|
|
intent.removeExtra(Notifications.EXTRAS_TYPE);
|
|
|
|
intent.putExtra(Notifications.TYPE_KEY, ReminderService.TYPE_DUE);
|
|
|
|
intent.putExtra(Notifications.EXTRAS_TYPE, ReminderService.TYPE_DUE);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
new Notifications().onReceive(getContext(), intent);
|
|
|
|
|
|
|
|
|
|
|
|
// nonstop notification still sounds
|
|
|
|
// nonstop notification still sounds
|
|
|
|
|