notification improvements (#522)

* correctly filter notifications on Api >= 26, other fixes and refactoring

* use correct areNotificationsEnabled method in MainActivity

* change notification led color
This commit is contained in:
Konrad Pozniak 2018-02-12 22:03:08 +01:00 committed by GitHub
commit 0b59b8d0ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 78 additions and 55 deletions

View file

@ -201,11 +201,11 @@ public abstract class BaseActivity extends AppCompatActivity {
}
protected void setPullNotificationCheckInterval(long minutes) {
JobManager.instance().cancelAllForTag(NotificationPullJobCreator.NOTIFICATIONS_JOB_TAG);
long checkInterval = 1000 * 60 * minutes;
new JobRequest.Builder(NotificationPullJobCreator.NOTIFICATIONS_JOB_TAG)
.setPeriodic(checkInterval)
.setUpdateCurrent(true)
.setRequiredNetworkType(JobRequest.NetworkType.CONNECTED)
.build()
.schedule();