Overhaul notifications to fix various bugs.

Fixes #539, #564 and #568.
This commit is contained in:
akwizgran
2016-08-02 16:48:16 +01:00
parent 98337a16ec
commit dbdf567d4e
9 changed files with 344 additions and 101 deletions

View File

@@ -2,6 +2,7 @@ package org.briarproject.android.blogs;
import android.app.Activity;
import org.briarproject.android.api.AndroidNotificationManager;
import org.briarproject.android.controller.DbControllerImpl;
import org.briarproject.android.controller.handler.ResultExceptionHandler;
import org.briarproject.api.blogs.Blog;
@@ -38,6 +39,8 @@ public class BlogControllerImpl extends DbControllerImpl
protected Activity activity;
@Inject
protected EventBus eventBus;
@Inject
protected AndroidNotificationManager notificationManager;
@Inject
protected volatile BlogManager blogManager;
@@ -69,11 +72,14 @@ public class BlogControllerImpl extends DbControllerImpl
@Override
public void onActivityResume() {
notificationManager.blockNotification(groupId);
notificationManager.clearBlogPostNotification(groupId);
eventBus.addListener(this);
}
@Override
public void onActivityPause() {
notificationManager.unblockNotification(groupId);
eventBus.removeListener(this);
}