mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Use Inheritence for shared Forum and Blog Sharing Code
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package org.briarproject.android.sharing;
|
||||
|
||||
import org.briarproject.android.ActivityComponent;
|
||||
import org.briarproject.api.blogs.BlogSharingManager;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.db.DbException;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class SharingStatusBlogActivity extends SharingStatusActivity {
|
||||
|
||||
// Fields that are accessed from background threads must be volatile
|
||||
@Inject
|
||||
protected volatile BlogSharingManager blogSharingManager;
|
||||
|
||||
@Override
|
||||
public void injectActivity(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* This must only be called from the DbThread
|
||||
*/
|
||||
protected Collection<Contact> getSharedWith() throws DbException {
|
||||
return blogSharingManager.getSharedWith(getGroupId());
|
||||
}
|
||||
|
||||
/**
|
||||
* This must only be called from the DbThread
|
||||
*/
|
||||
protected Collection<Contact> getSharedBy() throws DbException {
|
||||
return blogSharingManager.getSharedBy(getGroupId());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user